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
66c8c9c3
Commit
66c8c9c3
authored
Mar 31, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Treat RFC-illegal negative (s-)max-age values as zero.
Fixes #887
parent
cd434659
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
rfc2616.c
bin/varnishd/rfc2616.c
+4
-1
r00887.vtc
bin/varnishtest/tests/r00887.vtc
+22
-0
No files found.
bin/varnishd/rfc2616.c
View file @
66c8c9c3
...
...
@@ -112,7 +112,10 @@ RFC2616_Ttl(const struct sess *sp)
http_GetHdrField
(
hp
,
H_Cache_Control
,
"max-age"
,
&
p
))
&&
p
!=
NULL
)
{
max_age
=
strtoul
(
p
,
NULL
,
0
);
if
(
*
p
==
'-'
)
max_age
=
0
;
else
max_age
=
strtoul
(
p
,
NULL
,
0
);
if
(
http_GetHdr
(
hp
,
H_Age
,
&
p
))
{
age
=
strtoul
(
p
,
NULL
,
0
);
sp
->
wrk
->
age
=
age
;
...
...
bin/varnishtest/tests/r00887.vtc
0 → 100644
View file @
66c8c9c3
# $Id$
test "Ticket #887"
server s1 {
rxreq
txresp -hdr "Cache-control: max-age=-1000" -body "FOO"
rxreq
txresp -body "FOOBAR"
} -start
varnish v1 -vcl+backend {
} -start
client c1 {
txreq
rxresp
expect resp.bodylen == 3
txreq
rxresp
expect resp.bodylen == 6
} -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