aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2013-12-27 19:40:04 +0400
committerRuslan Ermilov <ru@nginx.com>2013-12-27 19:40:04 +0400
commit2539ce036f6f9d9c2f0e9d6e723d1f0785b9dc0a (patch)
treec95c1efb10a75e40fd83629d156bdd116abd1ae7 /src
parent2b1156d1018bbeb0ebdc46c576cd5adb203db373 (diff)
downloadnginx-2539ce036f6f9d9c2f0e9d6e723d1f0785b9dc0a.tar.gz
nginx-2539ce036f6f9d9c2f0e9d6e723d1f0785b9dc0a.zip
Fixed setting of content type in some cases.
This fixes content type set in stub_status and autoindex responses to be usable in content type checks made by filter modules, such as charset and sub filters.
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_autoindex_module.c1
-rw-r--r--src/http/modules/ngx_http_image_filter_module.c1
-rw-r--r--src/http/modules/ngx_http_stub_status_module.c2
3 files changed, 4 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c
index 221455120..f694df075 100644
--- a/src/http/modules/ngx_http_autoindex_module.c
+++ b/src/http/modules/ngx_http_autoindex_module.c
@@ -233,6 +233,7 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
r->headers_out.status = NGX_HTTP_OK;
r->headers_out.content_type_len = sizeof("text/html") - 1;
ngx_str_set(&r->headers_out.content_type, "text/html");
+ r->headers_out.content_type_lowcase = NULL;
rc = ngx_http_send_header(r);
diff --git a/src/http/modules/ngx_http_image_filter_module.c b/src/http/modules/ngx_http_image_filter_module.c
index cc41ef0d5..c983b973b 100644
--- a/src/http/modules/ngx_http_image_filter_module.c
+++ b/src/http/modules/ngx_http_image_filter_module.c
@@ -572,6 +572,7 @@ ngx_http_image_json(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
ngx_http_clean_header(r);
r->headers_out.status = NGX_HTTP_OK;
+ r->headers_out.content_type_len = sizeof("application/json") - 1;
ngx_str_set(&r->headers_out.content_type, "application/json");
r->headers_out.content_type_lowcase = NULL;
diff --git a/src/http/modules/ngx_http_stub_status_module.c b/src/http/modules/ngx_http_stub_status_module.c
index fe9132df8..b5ecd6d9e 100644
--- a/src/http/modules/ngx_http_stub_status_module.c
+++ b/src/http/modules/ngx_http_stub_status_module.c
@@ -98,7 +98,9 @@ static ngx_int_t ngx_http_status_handler(ngx_http_request_t *r)
return rc;
}
+ r->headers_out.content_type_len = sizeof("text/plain") - 1;
ngx_str_set(&r->headers_out.content_type, "text/plain");
+ r->headers_out.content_type_lowcase = NULL;
if (r->method == NGX_HTTP_HEAD) {
r->headers_out.status = NGX_HTTP_OK;