Is it possible to edit HTTP request using fiddler so that my asp.net application hosted elsewhere return true for the following code block
HttpContext.Current.Request.Url.Host 开发者_Python百科== "localhost"
Sure you can. Simply add the following:
if (oSession.hostname == "fakelocal"){
oSession.hostname = "localhost";
oSession["x-overrideHost"] = "123.1.1.1"; // <-- Server IP here!
}
Then, use the url: http://fakelocal/whatever in the client.
Fiddler will change the host header to "LOCALHOST" and direct the request to the server IP of your choice.
Note, of course, that this won't work if there's a proxy upstream, because upstream proxies do their own DNS lookups.
精彩评论