Skip to content

Commit 2e1718e

Browse files
bugfix: missing the content-type header introduced by commit de1b896.
1 parent 0d9f578 commit 2e1718e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/ngx_http_lua_util.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,11 +535,13 @@ ngx_http_lua_send_header_if_needed(ngx_http_request_t *r,
535535
r->headers_out.status = NGX_HTTP_OK;
536536
}
537537

538-
if (!ctx->headers_set) {
539-
if (ngx_http_lua_set_content_type(r, ctx) != NGX_OK) {
540-
return NGX_ERROR;
541-
}
538+
if (!ctx->mime_set
539+
&& ngx_http_lua_set_content_type(r, ctx) != NGX_OK)
540+
{
541+
return NGX_ERROR;
542+
}
542543

544+
if (!ctx->headers_set) {
543545
ngx_http_clear_content_length(r);
544546
ngx_http_clear_accept_ranges(r);
545547
}

0 commit comments

Comments
 (0)