[Varnish] #905: Modification of multi-line beresp or resp header mangles value
Varnish
varnish-bugs at varnish-cache.org
Mon Apr 18 16:58:39 CEST 2011
#905: Modification of multi-line beresp or resp header mangles value
-------------------+--------------------------------------------------------
Reporter: lrowe | Type: defect
Status: new | Priority: normal
Milestone: | Component: varnishd
Version: 2.1.5 | Severity: normal
Keywords: |
-------------------+--------------------------------------------------------
In order to work around an nginx bug (nginx is in front of varnish), I
would like to merge the multiline Vary header from my backend into a
single line. Attempting this with the following minimal vcl
{{{
backend default { .host = "127.0.0.1"; .port = "8080"; }
sub vcl_fetch { set beresp.http.Vary = regsuball(beresp.http.Vary, ",\s+",
", "); }
}}}
Results in the multiple lines of the header being split up, as can be seen
in the varnishlog excerpts (full log attached):
{{{
9 RxProtocol b HTTP/1.1
9 RxStatus b 200
9 RxResponse b OK
9 RxHeader b Server: Zope/(2.13.6, python 2.6.6, darwin) ZServer/1.1
9 RxHeader b Date: Mon, 18 Apr 2011 14:44:14 GMT
9 RxHeader b Content-Length: 2701
9 RxHeader b X-Cache-Operation: plone.app.caching.moderateCaching
9 RxHeader b Content-Language:
9 RxHeader b Content-Encoding: gzip
9 RxHeader b Expires: Fri, 20 Apr 2001 14:44:14 GMT
9 RxHeader b Vary: X-Anonymous,
9 RxHeader b Accept-Encoding
9 RxHeader b ETag: "||373||1|Sunburst Theme|0|0|1302790083.61"
9 RxHeader b Cache-Control: max-age=0, s-maxage=3600, must-revalidate
9 RxHeader b X-Cache-Rule: plone.content.folderView
9 RxHeader b Content-Type: text/html;charset=utf-8
...
7 VCL_call c fetch
7 VCL_return c deliver
7 ObjProtocol c HTTP/1.1
7 ObjStatus c 200
7 ObjResponse c OK
7 ObjHeader c Server: Zope/(2.13.6, python 2.6.6, darwin) ZServer/1.1
7 ObjHeader c Date: Mon, 18 Apr 2011 14:44:14 GMT
7 ObjHeader c X-Cache-Operation: plone.app.caching.moderateCaching
7 ObjHeader c Content-Language:
7 ObjHeader c Content-Encoding: gzip
7 ObjHeader c Expires: Fri, 20 Apr 2001 14:44:14 GMT
7 ObjHeader c Accept-Encoding
7 ObjHeader c ETag: "||373||1|Sunburst Theme|0|0|1302790083.61"
7 ObjHeader c Cache-Control: max-age=0, s-maxage=3600, must-revalidate
7 ObjHeader c X-Cache-Rule: plone.content.folderView
7 ObjHeader c Content-Type: text/html;charset=utf-8
7 ObjHeader c Vary: X-Anonymous,
}}}
The same effect is seen when using:
{{{
sub vcl_deliver { set resp.http.Vary = regsuball(resp.http.Vary, ",\s+",
", "); }
}}}
--
Ticket URL: <http://www.varnish-cache.org/trac/ticket/905>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator
More information about the varnish-bugs
mailing list