Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 5631800

Browse files
authored
Don't respond with an entitybody to HEAD requests for html (#1376)
Mind r->header_only when processing the response body. Fixes #1375
1 parent a7d1f91 commit 5631800

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ngx_pagespeed.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ ngx_http_output_body_filter_pt ngx_http_next_body_filter;
239239
ngx_int_t ps_base_fetch_filter(ngx_http_request_t* r, ngx_chain_t* in) {
240240
ps_request_ctx_t* ctx = ps_get_request_context(r);
241241

242+
if (r->header_only) {
243+
return NGX_OK;
244+
}
242245
if (ctx == NULL || ctx->base_fetch == NULL) {
243246
return ngx_http_next_body_filter(r, in);
244247
}

0 commit comments

Comments
 (0)