Commit ff2647b2 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Don't do conditional processing for hit-for-pass objects.

Fixes	#1206
Found & Fixed by:	DocWilco
parent 881ebc72
......@@ -108,6 +108,7 @@ RES_BuildHttp(struct req *req)
char time_str[30];
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
http_ClrHeader(req->resp);
http_FilterResp(req->obj->http, req->resp, 0);
......@@ -122,7 +123,9 @@ RES_BuildHttp(struct req *req)
if (req->res_mode & RES_GUNZIP)
http_Unset(req->resp, H_Content_Encoding);
if (req->obj->response == 200
if (req->obj->objcore != NULL
&& !(req->obj->objcore->flags & OC_F_PASS)
&& req->obj->response == 200
&& req->http->conds && RFC2616_Do_Cond(req)) {
req->wantbody = 0;
http_SetResp(req->resp, "HTTP/1.1", 304, "Not Modified");
......
varnishtest "Pass shouldn't honor IMS/INM if the backend doesn't"
server s1 {
rxreq
txresp -bodylen 6
rxreq
txresp -hdr "ETag: 123456789" \
-bodylen 7
rxreq
txresp -hdr "Last-Modified: Thu, 26 Jun 2008 12:00:01 GMT" \
-bodylen 8
} -start
varnish v1 -vcl+backend {
sub vcl_recv {
return(pass);
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.bodylen == 6
txreq -hdr "If-None-Match: 123456789"
rxresp
expect resp.status == 200
expect resp.bodylen == 7
txreq -hdr "If-Modified-Since: Thu, 26 Jun 2008 12:00:01 GMT"
rxresp
expect resp.status == 200
expect resp.bodylen == 8
} -run
server s1 -start
varnish v1 -vcl+backend {
sub vcl_fetch {
set beresp.do_pass = true;
}
}
client c1 -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment