Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349790

Summary: Gemini Web does not decode the WEB URL query string
Product: [RT] Gemini.Web Reporter: Violeta Georgieva <milesg78>
Component: unknownAssignee: Glyn Normington <glyn.normington>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: glyn.normington, hargrave
Version: unspecified   
Target Milestone: 2.0.0.RC1   
Hardware: All   
OS: All   
URL: https://www.osgi.org/members/bugzilla/show_bug.cgi?id=1736
Whiteboard:
Attachments:
Description Flags
Patch proposal
none
Patch proposal hargrave: review+

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.