]> err.no Git - varnish/commitdiff
Strip trailing whitespace on header lines from the stored result.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 19 Sep 2008 20:47:32 +0000 (20:47 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 19 Sep 2008 20:47:32 +0000 (20:47 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3205 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_http.c

index 18d50bb290719e50437e5fc4c2c411dc2166a959..fa978799225442c3c3a5ed586ee8ee0bfae6bb35 100644 (file)
@@ -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;