不正确的新的URI(基地,相对)在.NET中的行为 [英] Incorrect new Uri(base, relative) behaviour in .NET

查看:138
本文介绍了不正确的新的URI(基地,相对)在.NET中的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当你创建一个新的URI是这样的:

When you create a new Uri like this:

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

返回:

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

这应该返回:

It was supposed to return:

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

根据每一个主要的浏览器那里(的我不太知道RFC说,虽然的)。

这是一个bug或者有没有其他的功能,在那里其行为正确,也什么来解决它不重新发明轮子的最好方法是什么?

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?

推荐答案

是的,它看起来像我的错误。具体而言,我建议,当您报告这方面的连接您参阅 RFC 1808 ,特别是第4节5步和第5.1节这个例子:

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 :(

这篇关于不正确的新的URI(基地,相对)在.NET中的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆