Ticket #1255 (closed defect: fixed)

Opened 15 months ago

Last modified 15 months ago

Incorrect URL constructed for requests with an absolute URI in the request line

Reported by: tstarling Owned by: phk
Priority: normal Milestone:
Component: build Version: trunk
Severity: normal Keywords:
Cc:

Description

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

Change History

comment:1 Changed 15 months ago by phk

  • Owner set to phk

comment:2 Changed 15 months ago by Poul-Henning Kamp <phk@…>

In [2bbb032bf67871d7d5a43a38104d58f747f2e860]:

Split absolute URIs into URL and Host: as per RFC2616 5.2

Fixes #1255

comment:3 Changed 15 months ago by Poul-Henning Kamp <phk@…>

  • Status changed from new to closed
  • Resolution set to fixed

(In [2bbb032bf67871d7d5a43a38104d58f747f2e860]) Split absolute URIs into URL and Host: as per RFC2616 5.2

Fixes #1255

Note: See TracTickets for help on using tickets.