Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349790 - Gemini Web does not decode the WEB URL query string
Summary: Gemini Web does not decode the WEB URL query string
Status: CLOSED FIXED
Alias: None
Product: Gemini.Web
Classification: RT
Component: unknown (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 2.0.0.RC1   Edit
Assignee: Glyn Normington CLA
QA Contact:
URL: https://www.osgi.org/members/bugzilla...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-20 04:48 EDT by Violeta Georgieva CLA
Modified: 2011-07-19 09:46 EDT (History)
2 users (show)

See Also:


Attachments
Patch proposal (3.22 KB, patch)
2011-07-18 15:20 EDT, Violeta Georgieva CLA
no flags Details | Diff
Patch proposal (5.22 KB, patch)
2011-07-19 03:33 EDT, Violeta Georgieva CLA
hargrave: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Violeta Georgieva CLA 2011-06-20 04:48:59 EDT
The following sample WEB URL is not valid:
webbundle:file:<file-name>?Bunlde-SymbolicName=test test

It must be always in the following form:
webbundle:file:<file-name>?Bunlde-SymbolicName=test%20test

i.e. in encoded form.

The problem is that Gemini Web does not decode the query and instead of "test test" as symbolic name we have "test%20test" which is not correct.
Comment 1 Violeta Georgieva CLA 2011-06-22 02:34:08 EDT
Change is committed, tested and pushed.
Commit ID: 5d271faa4ae2e5a5e6934d3d0c447593d56a6d37
Comment 2 BJ Hargrave CLA 2011-06-30 20:46:55 EDT
It seems this fix does not properly handle decoding spaces encoded as '+' [1]. 

webbundle:file:<file-name>?Bundle-SymbolicName=test+test

has a valid query string and the value of "Bundle-SymbolicName" must be decoded as "test test".

[1] http://en.wikipedia.org/wiki/Query_string#URL_encoding
Comment 3 Violeta Georgieva CLA 2011-07-18 15:20:24 EDT
Created attachment 199861 [details]
Patch proposal

Could you please review the patch.
Regards
Violeta
Comment 4 BJ Hargrave CLA 2011-07-18 16:54:10 EDT
I think the fix is wrong. You are decoding the whole string and then parsing it. You need to parse it and then decode each part (key, value).

The query string: foo=ack%26barf&bar=nack

needs to be parsed into

foo = ack%26barf
bar = nack

and then decoded into

foo = ack&barf
bar = nack

If you decode the whole string first you get: foo=ack&barf&bar=nack 
which will be parsed quite differently.

Your function "parseQueryString" needs to be decoding each part after it is parsed out of the query string.
Comment 5 Violeta Georgieva CLA 2011-07-19 03:33:38 EDT
Created attachment 199875 [details]
Patch proposal

I agree.

I reworked the patch. Could you please comment it?

Regards
Violeta
Comment 6 BJ Hargrave CLA 2011-07-19 09:16:25 EDT
Comment on attachment 199875 [details]
Patch proposal

This patch look much better!
Comment 7 Glyn Normington CLA 2011-07-19 09:21:42 EDT
(In reply to comment #6)
> Comment on attachment 199875 [details]
> Patch proposal
> 
> This patch look much better!

Thanks BJ! Violeta is out of the office, so I'll be applying the patch.
Comment 8 Glyn Normington CLA 2011-07-19 09:27:16 EDT
Targeting 2.0.0.RC1 as this is highly desirable for 2.0.
Comment 9 Glyn Normington CLA 2011-07-19 09:46:11 EDT
Fixed in commit 1513e16cec1708ed428382160c44548f35131491.