是否可以使用fiddler编辑HTTP请求,以便我在其他地方托管的asp.net应用程序为以下代码块返回true
HttpContext.Current.Request.Url.Host == "localhost"
解决方法
你当然可以.只需添加以下内容:
if (oSession.hostname == "fakelocal"){ oSession.hostname = "localhost"; oSession["x-overrideHost"] = "123.1.1.1"; // <-- Server IP here! }
然后,在客户端中使用url:http://fakelocal/whatever.
Fiddler会将主机头更改为“LOCALHOST”并将请求定向到您选择的服务器IP.
当然,请注意,如果上游有代理,这将无效,因为上游代理会执行自己的DNS查找.