From 7bb6b9c0fe282469f91baf2b47f692ae1bb1bc97 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 19 Sep 2008 20:47:32 +0000 Subject: [PATCH] Strip trailing whitespace on header lines from the stored result. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3205 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_http.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/varnish-cache/bin/varnishd/cache_http.c b/varnish-cache/bin/varnishd/cache_http.c index 18d50bb2..fa978799 100644 --- a/varnish-cache/bin/varnishd/cache_http.c +++ b/varnish-cache/bin/varnishd/cache_http.c @@ -379,7 +379,6 @@ http_dissect_hdrs(struct worker *w, struct http *hp, int fd, char *p, txt t) r = q + 1; if (q > p && q[-1] == '\r') q--; - *q = '\0'; if (p == q) break; @@ -388,6 +387,10 @@ http_dissect_hdrs(struct worker *w, struct http *hp, int fd, char *p, txt t) p[2] == '-') hp->conds = 1; + while (q > p && vct_issp(q[-1])) + q--; + *q = '\0'; + if (hp->nhd < HTTP_HDR_MAX) { hp->hdf[hp->nhd] = 0; hp->hd[hp->nhd].b = p; -- 2.39.5