.NET中新的Uri(基本,相对)行为不正确

dr.*_*vil 6 .net constructor uri

当你像这样创建一个新的Uri时:

New Uri(New Uri("http://example.com/test.php"),"?x=y")
Run Code Online (Sandbox Code Playgroud)

它返回:

http://example.com/?x=y
Run Code Online (Sandbox Code Playgroud)

应该归还:

http://example.com/test.php?x=y
Run Code Online (Sandbox Code Playgroud)

根据那里的每个主要浏览器(我不太确定RFC说的是什么).

这是一个错误还是有任何其他功能正常,还有什么是最好的方法来修复它而不重新发明轮子?

Jon*_*eet 6

是的,对我来说这看起来像个错误.特别是,我建议您在Connect上报告此内容时,请参阅RFC 1808,特别是第4节第5步,以及使用此示例的第5.1节:

Base: http://a/b/c/d;p?q#f
Relative: ?y
Absolute: http://a/b/c/d;p?y
Run Code Online (Sandbox Code Playgroud)

不确定解决它的最佳方法,我害怕:(