Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libvfp-brotli
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvfp-brotli
Commits
e4d0b813
Commit
e4d0b813
authored
Feb 13, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test error handling.
parent
a966ae12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
errors.vtc
src/tests/errors.vtc
+79
-0
No files found.
src/tests/errors.vtc
0 → 100644
View file @
e4d0b813
# looks like -*- vcl -*-
varnishtest "test error handling"
# XXX I don't know how to provoke a error for compression, only
# decompresion.
server s1 {
rxreq
txresp -nolen -hdr "Content-Encoding: br" -hdr "Content-Length: 4"
sendhex "de ad be ef"
expect_close
} -start
varnish v1 -arg "-p vsl_mask=+VfpAcct" -vcl+backend {
import ${vmod_brotli};
sub vcl_backend_response {
set beresp.filters = "unbr";
}
} -start
# Streaming is enabled by default, so when the error is detected, both
# resp.status == 200 and Transfer-Encoding:chunked have been sent,
# with an empty client response body. So the connection closes just
# after sending the client response headers. (cf. Varnish issue #2903)
client c1 {
txreq
rxresphdrs
expect_close
} -run
server s1 -wait
server s1 -start
varnish v1 -vcl+backend {
import ${vmod_brotli};
sub vcl_backend_response {
set beresp.do_stream = false;
set beresp.filters = "unbr";
set beresp.uncacheable = true;
}
}
# With streaming disabled, the client gets a 503 response.
client c1 {
txreq
rxresp
expect resp.status == 503
} -run
server s1 -wait
# Correct brotli encoding followed by extraneous data.
server s1 {
rxreq
txresp -hdr "Content-Encoding: br" -body {Xyzzyjunk}
expect_close
} -start
client c1 -run
logexpect l1 -v v1 -d 1 -g vxid -q "VfpAcct" {
expect 0 * Begin bereq
expect * = FetchError {^Invalid brotli data: \S+}
expect * = VfpAcct {^unbr \d+ 0$}
expect * = End
expect 0 * Begin bereq
expect * = FetchError {^Invalid brotli data: \S+}
expect * = VfpAcct {^unbr \d+ 0$}
expect * = End
expect 0 * Begin bereq
expect * = FetchError "Junk after brotli data"
expect * = VfpAcct {^unbr \d+ 0$}
expect * = End
} -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