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
194acd4f
Commit
194acd4f
authored
May 18, 2016
by
Poul-Henning Kamp
Committed by
Pål Hermunn Johansen
Jun 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow VCL set Last-Modified to be used for I-M-S processing.
Submitted by: rezan Fixes: #1931
parent
65d90e3d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
1 deletion
+47
-1
cache_rfc2616.c
bin/varnishd/cache/cache_rfc2616.c
+7
-1
v00047.vtc
bin/varnishtest/tests/v00047.vtc
+40
-0
No files found.
bin/varnishd/cache/cache_rfc2616.c
View file @
194acd4f
...
...
@@ -254,7 +254,7 @@ rfc2616_weak_compare(const char *p, const char *e)
int
RFC2616_Do_Cond
(
const
struct
req
*
req
)
{
const
char
*
p
,
*
e
;
const
char
*
p
,
*
e
,
*
l
;
double
ims
,
lm
;
/*
...
...
@@ -274,6 +274,12 @@ RFC2616_Do_Cond(const struct req *req)
ims
=
VTIM_parse
(
p
);
if
(
!
ims
||
ims
>
req
->
t_req
)
/* [RFC7232 3.3 p16] */
return
(
0
);
if
(
http_GetHdr
(
req
->
resp
,
H_Last_Modified
,
&
l
))
{
lm
=
VTIM_parse
(
l
);
if
(
!
lm
||
lm
>
ims
)
return
(
0
);
return
(
1
);
}
AZ
(
ObjGetDouble
(
req
->
wrk
,
req
->
objcore
,
OA_LASTMODIFIED
,
&
lm
));
if
(
lm
>
ims
)
return
(
0
);
...
...
bin/varnishtest/tests/v00047.vtc
0 → 100644
View file @
194acd4f
varnishtest "Changing Last Modified in vcl_deliver"
server s1 {
rxreq
txresp -hdr "Last-Modified: Wed, 27 Apr 2016 14:00:00 GMT"
} -start
varnish v1 -vcl+backend {
sub vcl_deliver {
if (req.http.deliver == "modify") {
set resp.http.Last-Modified = "Wed, 27 Apr 2016 16:00:00 GMT";
}
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
txreq -hdr "If-Modified-Since: Wed, 27 Apr 2016 14:00:00 GMT"
rxresp
expect resp.status == 304
txreq -hdr "If-Modified-Since: Wed, 27 Apr 2016 12:00:00 GMT"
rxresp
expect resp.status == 200
txreq -hdr "If-Modified-Since: Wed, 27 Apr 2016 14:00:00 GMT" -hdr "deliver: modify"
rxresp
expect resp.status == 200
txreq -hdr "If-Modified-Since: Wed, 27 Apr 2016 16:00:00 GMT" -hdr "deliver: modify"
rxresp
expect resp.status == 304
txreq -hdr "If-Modified-Since: Wed, 27 Apr 2016 18:00:00 GMT" -hdr "deliver: modify"
rxresp
expect resp.status == 304
} -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