urlrewriter
urlrewriter copied to clipboard
Using UrlRewriter triggers DNS reverse resolution of the remote host
Hi,
Refer to SO for further context.
I identified this code in RewriteContext as the culprit:
// Initialise the Properties collection from all the server variables, headers and cookies.
foreach (string key in httpContext.ServerVariables.AllKeys)
{
_properties.Add(key, httpContext.ServerVariables[key]);
}
REMOTE_HOST is a dynamic property that gets calculated only on access. Here UrlRewriter makes a copy of all server variables, triggering DNS requests even if not used anywhere in the app or rewriting rules.
Cheers, Rob