asp.netiis-7integrated-pipeline-mode

Why does GetServerVariable("HTTP_URL") return different value depending on the pipeline mode


In IIS, why does calling GetServerVariable("HTTP_URL") of the HttpWorkerRequest class result in different values depending on the pipeline mode?

When running under Integrated mode, it returns the raw url (that the server sees e.g, "/SomeUrl/Default.ashx").

While under Classic mode it seems like the value is the url that was typed into the browser (my url router maps for example /someurl to that specific handler).


Solution

  • Finally resolved this. Turns out we were doing a HttpContext.RewritePath which (I think) changes the result of GetServerVariable("HTTP_URL") under Integrated Mode. We replaced this by newing up the corresponding IHttpHandler and invoking it, instead of rewriting the path.