Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to edit HTTP request with Fiddler

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"
like image 226
Raj Avatar asked Oct 15 '22 02:10

Raj


1 Answers

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.

like image 123
EricLaw Avatar answered Nov 10 '22 01:11

EricLaw