[master] de11d7d9e h2: Relax "no //" URLs requirement
Nils Goroll
nils.goroll at uplex.de
Mon Apr 24 13:55:07 UTC 2023
commit de11d7d9e898a5668d3d5dc9e7eb55fc826b40da
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date: Mon Apr 3 10:26:51 2023 +0200
h2: Relax "no //" URLs requirement
This requirement was dropped in the updated rfc 9113.
Fixes: #3911
diff --git a/bin/varnishd/http2/cache_http2_hpack.c b/bin/varnishd/http2/cache_http2_hpack.c
index 36570a751..8384856dd 100644
--- a/bin/varnishd/http2/cache_http2_hpack.c
+++ b/bin/varnishd/http2/cache_http2_hpack.c
@@ -135,10 +135,9 @@ h2h_addhdr(struct http *hp, char *b, size_t namelen, size_t len)
n = HTTP_HDR_URL;
disallow_empty = 1;
- // rfc7540,l,3060,3071
- if (((len > 0 && *b != '/') ||
- (len > 1 && *(b+1) == '/')) &&
- (strncmp(b, "*", len) != 0)) {
+ // rfc9113,l,2693,2705
+ if (len > 0 && *b != '/' &&
+ strncmp(b, "*", len) != 0) {
VSLb(hp->vsl, SLT_BogoHeader,
"Illegal :path pseudo-header %.*s",
(int)len, b);
diff --git a/bin/varnishtest/tests/a02027.vtc b/bin/varnishtest/tests/a02027.vtc
index ff34b0071..e9dcf6619 100644
--- a/bin/varnishtest/tests/a02027.vtc
+++ b/bin/varnishtest/tests/a02027.vtc
@@ -22,8 +22,8 @@ client c1 {
client c1 {
stream 1 {
txreq -noadd -hdr ":authority" "foo.com" -hdr ":path" "//foo" -hdr ":scheme" "http" -hdr ":method" "GET"
- rxrst
- expect rst.err == PROTOCOL_ERROR
+ rxresp
+ expect resp.status == 200
} -run
} -run
More information about the varnish-commit
mailing list