Ticket #1255 (closed defect: fixed)
Incorrect URL constructed for requests with an absolute URI in the request line
|Reported by:||tstarling||Owned by:||phk|
According to RFC 2616 section 5.1.2:
"To allow for transition to absoluteURIs in all requests in future versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI form in requests, even though HTTP/1.1 clients will only generate them in requests to proxies."
This handy property of HTTP is commonly used to route requests to the desired server in a cluster, by setting the HTTP proxy parameter in a client such as cURL or LWP. Varnish does not follow this specified behaviour in some respects.
If I send such a request to a Varnish 3.0.3 server, for example with:
curl -x varnish:80 http://upload.wikimedia.org/foo
varnishncsa reports a log entry with a URL of
That is, the protocol and host header are simply concatenated to the request URI, whether it is absolute or not.
The request appears to be forwarded correctly to the backend, but the bug does break purging:
See the terrible hackish workaround we implemented to allow purging from an LWP client: