Dhruti90 / google-gdata1111

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

ParseUri method of DocumentQuery fails on ' ' characters #313

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a DocumentListQuery with a Title = "something with a blank"
2. Look at the query.Uri string - seems ok. Also the query.Title.
3. Create a new DocumentListQuery with the same base uri, and then perform
query2.Uri = query.Uri;

What is the expected output? What do you see instead?
I'd expect to see
query2.Title == query.Title
However, the 2nd query will contains something like 
"something%20with%20a%20blank" in the Title field. All coming out from the 
ParseUri method, when calling the targetUri.Query - it switches blanks for 
"%20".
The end result is when trying to clone a query containing a blank, the 2nd 
query will not return the same results as the original would.

I think maybe a safer approach will be to use targetUri.ToString(), and 
then just extract the bit after the '?'
targetUri.ToString().Substring(targetUri.ToString().IndexOf('?') + 1)

Please use labels and text to provide additional information.

Original issue reported on code.google.com by ATGard...@gmail.com on 13 Jan 2010 at 1:28

GoogleCodeExporter commented 9 years ago
I am seeing the same kind of bug in FeedQuery ParseUri method - using the 
targetUri.Query property, which replaces blanks for %20.

Original comment by ATGard...@gmail.com on 19 Jan 2010 at 12:39

GoogleCodeExporter commented 9 years ago
Fixed in rev. 1074

Original comment by ccherub...@google.com on 8 Mar 2011 at 4:32