This repository has been archived by the owner on Jul 30, 2021. It is now read-only.
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Check for duplicate Content-Length headers in requests
If a duplicate CL header is in the request, we fail the request with a 400 (Bad Request) Fix a test case that was sending duplicate CL by misstake and would not fail because of that.
- Loading branch information
1 parent
85e8468
commit 29870c8
Showing
3 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| varnishtest "Fail request on duplicate Content-Length headers in requests" | ||
|
|
||
| server s1 { | ||
| rxreq | ||
| txresp | ||
| } -start | ||
|
|
||
| varnish v1 -vcl+backend { | ||
| sub vcl_deliver { | ||
| if (req.http.foo) { | ||
| set resp.http.Foo = req.http.foo; | ||
| } | ||
| if (req.http.bar) { | ||
| set resp.http.Bar = req.http.bar; | ||
| } | ||
| } | ||
| } -start | ||
|
|
||
| client c1 { | ||
| txreq -req POST -hdr "Content-Length: 5" -body "12345" | ||
| rxresp | ||
| expect resp.status == 400 | ||
| } -run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters