Don't respond with an entitybody to HEAD requests for html (#1376)

Mind r->header_only when processing the response body.

Fixes https://github.com/pagespeed/ngx_pagespeed/issues/1375
This commit is contained in:
Otto van der Schaaf
2017-02-07 12:02:43 +01:00
committed by GitHub
parent a7d1f91dc3
commit 5631800479
+3
View File
@@ -239,6 +239,9 @@ ngx_http_output_body_filter_pt ngx_http_next_body_filter;
ngx_int_t ps_base_fetch_filter(ngx_http_request_t* r, ngx_chain_t* in) { ngx_int_t ps_base_fetch_filter(ngx_http_request_t* r, ngx_chain_t* in) {
ps_request_ctx_t* ctx = ps_get_request_context(r); ps_request_ctx_t* ctx = ps_get_request_context(r);
if (r->header_only) {
return NGX_OK;
}
if (ctx == NULL || ctx->base_fetch == NULL) { if (ctx == NULL || ctx->base_fetch == NULL) {
return ngx_http_next_body_filter(r, in); return ngx_http_next_body_filter(r, in);
} }