[Varnish] #1255: Incorrect URL constructed for requests with an absolute URI in the request line

Varnish varnish-bugs at varnish-cache.org
Wed Jan 23 13:00:48 CET 2013


#1255: Incorrect URL constructed for requests with an absolute URI in the request
line
-----------------------+--------------------
 Reporter:  tstarling  |       Type:  defect
   Status:  new        |   Priority:  normal
Milestone:             |  Component:  build
  Version:  trunk      |   Severity:  normal
 Keywords:             |
-----------------------+--------------------
 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

 http://upload.wikimedia.orghttp://upload.wikimedia.org/foo

 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:

 https://bugzilla.wikimedia.org/show_bug.cgi?id=39005

 See the terrible hackish workaround we implemented to allow purging from
 an LWP client:

 https://gerrit.wikimedia.org/r/gitweb?p=operations/puppet.git;a=blob;f=templates/varnish/wikimedia.vcl.erb;h=e041f817fe6878389d6135cf27091f31ea706aa4;hb=d061399ab9488e2685ad56dee1853d54b5020577#l211

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1255>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list