[mod_deflate] fix to return 304 with If-None-Match (fixes #3143)

(thx meier22)

Bug in lighttpd 1.4.51 - lighttpd 1.4.64

x-ref:
  "mod_deflate not returning 304 Not Modified for If-None-Match request"
  https://redmine.lighttpd.net/issues/3143
  "How to get 304 Not Modified - response with mod_deflate"
  https://redmine.lighttpd.net/boards/2/topics/10253
master
Glenn Strauss 1 year ago
parent 4432e34253
commit 2759d1eb00

@ -1849,7 +1849,7 @@ REQUEST_FUNC(mod_deflate_handle_response_start) {
vb = http_header_response_get(r, HTTP_HEADER_ETAG, CONST_STR_LEN("ETag"));
etaglen = vb ? buffer_clen(vb) : 0;
if (etaglen && light_btst(r->rqst_htags, HTTP_HEADER_IF_NONE_MATCH)) {
const buffer *if_none_match = http_header_response_get(r, HTTP_HEADER_IF_NONE_MATCH, CONST_STR_LEN("If-None-Match"));
const buffer *if_none_match = http_header_request_get(r, HTTP_HEADER_IF_NONE_MATCH, CONST_STR_LEN("If-None-Match"));
if ( r->http_status < 300 /*(want 2xx only)*/
&& NULL != if_none_match
&& 0 == strncmp(if_none_match->ptr, vb->ptr, etaglen-1)

Loading…
Cancel
Save