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
dbbb1fb2
Commit
dbbb1fb2
authored
Mar 15, 2018
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep Content-Encoding intact if http_gzip_support is disabled
Fixes #2610
parent
6b8e44ff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
3 deletions
+34
-3
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+7
-3
g00003.vtc
bin/varnishtest/tests/g00003.vtc
+27
-0
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
dbbb1fb2
...
...
@@ -521,6 +521,11 @@ vbf_figure_out_vfp(struct busyobj *bo)
*
*/
if
(
!
cache_param
->
http_gzip_support
)
{
bo
->
do_gzip
=
bo
->
do_gunzip
=
0
;
return
(
0
);
}
if
(
http_GetStatus
(
bo
->
beresp
)
==
206
)
{
if
(
bo
->
do_esi
)
{
VSLb
(
bo
->
vsl
,
SLT_VCL_Error
,
...
...
@@ -531,10 +536,9 @@ vbf_figure_out_vfp(struct busyobj *bo)
return
(
0
);
}
/* No body
or no GZIP support
-> done */
/* No body -> done */
if
(
bo
->
htc
->
body_status
==
BS_NONE
||
bo
->
htc
->
content_length
==
0
||
!
cache_param
->
http_gzip_support
)
{
bo
->
htc
->
content_length
==
0
)
{
http_Unset
(
bo
->
beresp
,
H_Content_Encoding
);
bo
->
do_gzip
=
bo
->
do_gunzip
=
0
;
bo
->
do_stream
=
0
;
...
...
bin/varnishtest/tests/g00003.vtc
View file @
dbbb1fb2
...
...
@@ -15,6 +15,18 @@ server s1 {
expect req.url == "/foobar"
expect req.http.accept-encoding == "gzip"
txresp -bodylen 43
rxreq
expect req.url == "/nogzip"
expect req.http.accept-encoding == "gzip"
txresp -hdr "Vary: Accept-Encoding" \
-gzipbody "keep gzip real"
rxreq
expect req.url == "/nogzip"
expect req.http.accept-encoding == <undef>
txresp -hdr "Vary: Accept-Encoding" \
-body "keep plain real"
} -start
varnish v1 -cliok "param.set http_gzip_support true" -vcl+backend {
...
...
@@ -53,3 +65,18 @@ client c1 {
varnish v1 -expect n_gzip == 1
varnish v1 -expect n_gunzip == 2
varnish v1 -expect n_test_gunzip == 0
varnish v1 -cliok "param.set http_gzip_support false"
client c1 {
txreq -url /nogzip -hdr "Accept-Encoding: gzip"
rxresp
expect resp.http.content-encoding == "gzip"
gunzip
expect resp.body == "keep gzip real"
txreq -url /nogzip
rxresp
expect resp.http.content-encoding == <undef>
expect resp.body == "keep plain real"
} -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