summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_special_response.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_special_response.c')
-rw-r--r--src/http/ngx_http_special_response.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c
index 8f9d8ce7d..017376a5b 100644
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -224,13 +224,17 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error)
return NGX_ERROR;
}
- r->headers_out.content_type->key.len = 12;
+ r->headers_out.content_type->key.len = sizeof("Content-Type") - 1;
r->headers_out.content_type->key.data = "Content-Type";
- r->headers_out.content_type->value.len = 9;
+ r->headers_out.content_type->value.len = sizeof("text/html") - 1;
r->headers_out.content_type->value.data = "text/html";
} else {
r->headers_out.content_length_n = -1;
+ }
+
+ if (r->headers_out.content_length) {
+ r->headers_out.content_length->key.len = 0;
r->headers_out.content_length = NULL;
}