[master] 9e96c4c15 Update validhdr() / validate_headers related rfc reference

Nils Goroll nils.goroll at uplex.de
Sun Nov 3 13:59:06 UTC 2024


commit 9e96c4c15ea012ca31c4791153ab92e7ae6caf43
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sun Nov 3 14:35:32 2024 +0100

    Update validhdr() / validate_headers related rfc reference
    
    See #4221 for additional finding

diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index 7f4378fb9..39c8ef53c 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -539,8 +539,14 @@ VRT_UpperLowerStrands(VRT_CTX, VCL_STRANDS s, int up)
 	return (r);
 }
 
-// rfc7230,l,1243,1244
-// ASCII VCHAR + TAB + obs-text (0x80-ff)
+
+// rfc9110,l,1585,1589
+//     field-content  = field-vchar
+//                      [ 1*( SP / HTAB / field-vchar ) field-vchar ]
+//     field-vchar    = VCHAR / obs-text
+//     obs-text       = %x80-FF
+//
+// This implementation is less strict, see #4221
 static inline VCL_BOOL
 validhdr(const char *p)
 {
diff --git a/bin/varnishtest/tests/b00049.vtc b/bin/varnishtest/tests/b00049.vtc
index 4ad6d4988..b21d01b64 100644
--- a/bin/varnishtest/tests/b00049.vtc
+++ b/bin/varnishtest/tests/b00049.vtc
@@ -1,4 +1,4 @@
-varnishtest "RFC 7230 compliance"
+varnishtest "RFC 9110 compliance"
 
 server s1 {
 	rxreq
diff --git a/include/tbl/feature_bits.h b/include/tbl/feature_bits.h
index 808efe917..c7412ea2d 100644
--- a/include/tbl/feature_bits.h
+++ b/include/tbl/feature_bits.h
@@ -79,7 +79,7 @@ FEATURE_BIT(WAIT_SILO,			wait_silo,
 )
 
 FEATURE_BIT(VALIDATE_HEADERS,		validate_headers,
-    "Validate all header set operations to conform to RFC7230."
+    "Validate all header set operations to conform to RFC9110 section 5.5."
 )
 
 FEATURE_BIT(BUSY_STATS_RATE,	busy_stats_rate,
diff --git a/vmod/vmod_debug.vcc b/vmod/vmod_debug.vcc
index e3f80b0cc..8e9a25c3e 100644
--- a/vmod/vmod_debug.vcc
+++ b/vmod/vmod_debug.vcc
@@ -374,7 +374,7 @@ A function mixing a named PRIV_TASK with optional parameters.
 
 $Function BOOL validhdr(STRANDS)
 
-Test if the argument is a valid header according to RFC7230 section 3.2.
+Test if the argument is a valid header according to RFC9110 section 5.5.
 
 $Function REGEX just_return_regex(REGEX)
 


More information about the varnish-commit mailing list