https://bz.apache.org/bugzilla/show_bug.cgi?id=58231

            Bug ID: 58231
           Summary: RewriteCond can add "Host" to the Vary-Header
           Product: Apache httpd-2
           Version: 2.4.16
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_rewrite
          Assignee: [email protected]
          Reporter: [email protected]

A RewriteCond that evaluates %{HTTP_HOST} automatically adds "Host" to the
Vary-Header. This is unnecessary and not permitted according to
https://tools.ietf.org/html/rfc7231#section-7.1.4

> The "Vary" header field in a response describes what parts of a request 
> message, aside from the method, Host header field, and request target, might 
> influence the origin server's process for selecting and representing this 
> response.

The RewriteRule that triggered the Vary: Host for me is below, however, I'm
certain simpler examples can be constructed:

RewriteCond expr "%{HTTP_REFERER} =~ m#^https?://([^/:]+)# && %{HTTP_HOST}.':'
-strmatch '$1:*'"
RewriteRule ^ - [env=FOO:bar]

> GET /foo/lenna/ HTTP/1.1
> User-Agent: curl/7.38.0
> Host: pahuanuiapitaaitera.office.sevenval.de:14020
> Accept: */*
> Referer: http://$1/
> 
< HTTP/1.1 200 OK
< Date: Tue, 11 Aug 2015 11:58:01 GMT
< Server: Apache
< Vary: User-Agent,Referer,Host,Accept-Encoding
[,...]

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to