Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
4e5728c5
Commit
4e5728c5
authored
Sep 28, 2022
by
AlveElde
Committed by
Martin Blix Grydeland
Oct 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add coverage for Keep-Alive header removal
parent
1e9fae53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
b00080.vtc
bin/varnishtest/tests/b00080.vtc
+77
-0
No files found.
bin/varnishtest/tests/b00080.vtc
0 → 100644
View file @
4e5728c5
varnishtest "Keep-Alive is a hop-by-hop header"
server s1 {
rxreq
expect req.http.req-keep-alive == "true"
expect req.http.bereq-keep-alive == "false"
expect req.http.Keep-Alive == <undef>
txresp -hdr "Keep-Alive: 1"
rxreq
expect req.http.req-keep-alive == "true"
expect req.http.bereq-keep-alive == "false"
expect req.http.Keep-Alive == <undef>
txresp -hdr "Connection: Keep-Alive" -hdr "Keep-Alive: 2"
rxreq
expect req.http.req-keep-alive == "true"
expect req.http.bereq-keep-alive == "false"
expect req.http.Keep-Alive == <undef>
expect req.http.Cookie == "3"
txresp -hdr "Keep-Alive: 3"
rxreq
expect req.http.req-keep-alive == "true"
expect req.http.bereq-keep-alive == "false"
expect req.http.Keep-Alive == <undef>
expect req.http.Cookie == "4"
txresp -hdr "Connection: Keep-Alive" -hdr "Keep-Alive: 4"
} -start
varnish v1 -vcl+backend {
sub vcl_recv {
set req.http.req-keep-alive = !(!req.http.Keep-Alive);
}
sub vcl_backend_fetch {
set bereq.http.bereq-keep-alive = !(!bereq.http.Keep-Alive);
}
sub vcl_backend_response {
set beresp.http.beresp-keep-alive = !(!beresp.http.Keep-Alive);
}
sub vcl_deliver {
set resp.http.resp-keep-alive = !(!resp.http.Keep-Alive);
}
} -start
client c1 {
txreq -url "/1" -hdr "Keep-Alive: 1"
rxresp
expect resp.status == 200
expect resp.http.beresp-keep-alive == "true"
expect resp.http.resp-keep-alive == "false"
expect resp.http.Keep-Alive == <undef>
txreq -url "/2" -hdr "Connection: Keep-Alive" -hdr "Keep-Alive: 2"
rxresp
expect resp.status == 200
expect resp.http.beresp-keep-alive == "true"
expect resp.http.resp-keep-alive == "false"
expect req.http.Keep-Alive == <undef>
txreq -url "/3" -hdr "Keep-Alive: 3" -hdr "Cookie: 3"
rxresp
expect resp.status == 200
expect resp.http.beresp-keep-alive == "true"
expect resp.http.resp-keep-alive == "false"
expect resp.http.Keep-Alive == <undef>
txreq -url "/4" -hdr "Connection: Keep-Alive" -hdr "Keep-Alive: 4" -hdr "Cookie: 4"
rxresp
expect resp.status == 200
expect resp.http.beresp-keep-alive == "true"
expect resp.http.resp-keep-alive == "false"
expect req.http.Keep-Alive == <undef>
} -run
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment