Skip to content

Commit

Permalink
vtc: More HPACK header validation coverage
Browse files Browse the repository at this point in the history
Adds coverage for tab characters at start/end of field value.

Regarding the "fo o" " bar" header, it cumulates an error in the name
and another in the value, but only one of them will trigger the expected
PROTOCOL_ERROR. Only the invalid "fo o" is checked now, and the other
error is part of the new coverage.

Signed-off-by: Dridi Boukelmoune <[email protected]>
  • Loading branch information
walid-git authored and dridi committed Sep 26, 2023
1 parent 325faac commit bc3e420
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion bin/varnishtest/tests/t02023.vtc
Original file line number Diff line number Diff line change
Expand Up @@ -30,70 +30,96 @@ client c1 {
stream 1 {
txreq -url ""
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

client c1 {
stream 1 {
txreq -scheme ""
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

client c1 {
stream 1 {
txreq -req ""
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

varnish v1 -vsl_catchup

client c1 {
stream 1 {
txreq -hdr "fo o" " bar"
txreq -hdr "foo" " bar"
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

client c1 {
stream 1 {
txreq -hdr "foo" " "
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

client c1 {
stream 1 {
txreq -hdr ":foo" "bar"
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

client c1 {
stream 1 {
txreq -hdr "foo" "b\x0car"
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

client c1 {
stream 1 {
txreq -hdr "f o" "bar"
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

client c1 {
stream 1 {
txreq -hdr "f: o" "bar"
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

client c1 {
stream 1 {
txreq -hdr "foo" "bar "
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

client c1 {
stream 1 {
txreq -hdr "foo" " bar"
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

client c1 {
stream 1 {
txreq -hdr "foo" "bar "
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run

0 comments on commit bc3e420

Please sign in to comment.