views:

119

answers:

1

When you create a new Uri like this:

New Uri(New Uri("http://example.com/test.php"),"?x=y")

it returns:

http://example.com/?x=y

It was supposed to return:

http://example.com/test.php?x=y

according to the every major browser out there (I'm not quite sure what RFC says though).

Is this is a bug or is there any other function out there which behaves correctly, also what's the best way to fix it without reinventing the wheel?

+4  A: 

Yes, it looks like a bug to me. In particular, I would suggest that when you report this on Connect you refer to RFC 1808, in particular section 4 step 5, and section 5.1 with this example:

Base: http://a/b/c/d;p?q#f
Relative: ?y
Absolute: http://a/b/c/d;p?y

Not sure about the best way to fix it, I'm afraid :(

Jon Skeet
bummer :) Thanks for pointing to correct RFC. I'll do some dodgy fix.
dr. evil