urlrewriter icon indicating copy to clipboard operation
urlrewriter copied to clipboard

Using UrlRewriter triggers DNS reverse resolution of the remote host

Open jocutajar opened this issue 8 years ago • 0 comments

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

jocutajar avatar Aug 16 '16 15:08 jocutajar