Mailing List Archive

[6.0] e32ab13b8 h2: Relax "no //" URLs requirement
commit e32ab13b8c1a63fc55c4e1749a6cd7aae44cee8d
Author: Dag Haavi Finstad <daghf@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 1e46c4b8d..57ca82390 100644
--- a/bin/varnishd/http2/cache_http2_hpack.c
+++ b/bin/varnishd/http2/cache_http2_hpack.c
@@ -134,10 +134,9 @@ h2h_addhdr(struct h2h_decode *d, struct http *hp, char *b, size_t namelen,
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
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit