-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gzip: Heal-the-BREACH mitigation for gzip VFP
- Loading branch information
Showing
2 changed files
with
69 additions
and
1 deletion.
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,50 @@ | ||
varnishtest "Heal-the-BREACH mitigation during fetch" | ||
|
||
server s0 { | ||
rxreq | ||
txresp -bodylen 4001 | ||
} -dispatch | ||
|
||
varnish v1 -cliok "param.set feature +gzip_breach" | ||
varnish v1 -vcl+backend { | ||
sub vcl_recv { | ||
return (pass); | ||
} | ||
sub vcl_backend_response { | ||
set beresp.do_gzip = true; | ||
} | ||
} -start | ||
|
||
varnish v1 -cliok "debug.srandom" | ||
|
||
client c1 { | ||
txreq -hdr "accept-encoding: gzip" | ||
rxresp | ||
expect resp.bodylen == 381 | ||
gunzip | ||
expect resp.bodylen == 4001 | ||
|
||
txreq -hdr "accept-encoding: gzip" | ||
rxresp | ||
expect resp.bodylen == 485 | ||
gunzip | ||
expect resp.bodylen == 4001 | ||
|
||
txreq -hdr "accept-encoding: gzip" | ||
rxresp | ||
expect resp.bodylen == 430 | ||
gunzip | ||
expect resp.bodylen == 4001 | ||
|
||
txreq -hdr "accept-encoding: gzip" | ||
rxresp | ||
expect resp.bodylen == 277 | ||
gunzip | ||
expect resp.bodylen == 4001 | ||
|
||
txreq -hdr "accept-encoding: gzip" | ||
rxresp | ||
expect resp.bodylen == 414 | ||
gunzip | ||
expect resp.bodylen == 4001 | ||
} -run |