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 == "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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With