Hi Luca,
On Mon, Sep 18, 2017 at 7:08 PM, <[email protected]> wrote:
>
> Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
> URL:
> http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_rewrite.c?rev=1808746&r1=1808745&r2=1808746&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/mappers/mod_rewrite.c (original)
> +++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Mon Sep 18 17:08:54 2017
> @@ -2035,7 +2035,10 @@ static char *lookup_variable(char *var,
>
> case 'S':
> if (!strcmp(var, "HTTP_HOST")) {
> - result = lookup_header("Host", ctx);
> + /* Skip the 'Vary: Host' header combination
> + * as indicated in rfc7231 section-7.1.4
> + */
> + result = apr_table_get(ctx->r->headers_in, "Host");
Why not address this in lookup_header directly?
Looks like there several call sites...
Most seem to use a fixed name (other than "Host"), but the one around
line 1879 is:
if (!strncasecmp(var, "HTTP", 4)) {
result = lookup_header(var+5, ctx);
}
so possibly also a candidate.
This might be enough though, to avoid spurious cycles spent in lookup_header().
Regards,
Yann.