asp.net - Request.Url.Host identical to Request.Headers["host"]? -


i've read conflicting things on this: in asp.net (and mvc), request.url.host return host header request? i've seen code checks request.headers["host"] first, degrades using request.url.host if there problem, don't understand why needed if identical.

they're not identical.

httprequest.headers["host"] gives direct access client-to-server http header.

httprequest.url rebuilt asp.net , use incoming request's host: header default, there internal setting usehostheaderforrequesturl, if set false asp.net use httprequest.headers["server_name"] instead, under circumstances uses value of "127.0.0.1" instead.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -