[4.1] b26f9ff Don't insist headers have a space after the colon.
Poul-Henning Kamp
phk at FreeBSD.org
Fri Sep 4 15:54:52 CEST 2015
commit b26f9fff4877fbe1001c7f995df98f9241914e12
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Aug 3 12:55:44 2015 +0000
Don't insist headers have a space after the colon.
Fixes #1765
diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index 05edd1b..e832992 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -927,9 +927,8 @@ HTTP_GetHdrPack(struct worker *wrk, struct objcore *oc, const char *hdr)
while (*ptr != '\0') {
if (!strncasecmp(ptr, hdr, l)) {
ptr += l;
- assert (vct_issp(*ptr));
- ptr++;
- assert (!vct_issp(*ptr));
+ while (vct_islws(*ptr))
+ ptr++;
return (ptr);
}
ptr = strchr(ptr, '\0') + 1;
diff --git a/bin/varnishtest/tests/r01765.vtc b/bin/varnishtest/tests/r01765.vtc
new file mode 100644
index 0000000..e3d8323
--- /dev/null
+++ b/bin/varnishtest/tests/r01765.vtc
@@ -0,0 +1,27 @@
+varnishtest "subset headers in packed format"
+
+server s1 {
+ rxreq
+ txresp -hdr "Foo:bar"
+ rxreq
+ txresp -hdr "Foo:bax"
+} -start
+
+varnish v1 -vcl+backend {
+ sub vcl_hit {
+ if (obj.http.foo == "bar") {
+ return (pass);
+ }
+ }
+} -start
+
+client c1 {
+ txreq
+ rxresp
+ expect resp.http.foo == bar
+ txreq
+ rxresp
+ expect resp.http.foo == bax
+} -run
+
+delay 1
More information about the varnish-commit
mailing list