# HG changeset patch # User Igor Sysoev # Date 1243242389 0 # Node ID 896db5a09bd2def6acb0ad0f34f57a382087dd68 # Parent 13b63d6822285b5ebb0aba5397beaf19c9ae5fa9 reset content_type hash value, this fixes a bug when XSLT responses could not be processed by SSI, charset, and gzip filters diff --git a/src/http/modules/ngx_http_image_filter_module.c b/src/http/modules/ngx_http_image_filter_module.c --- a/src/http/modules/ngx_http_image_filter_module.c +++ b/src/http/modules/ngx_http_image_filter_module.c @@ -282,6 +282,7 @@ ngx_http_image_body_filter(ngx_http_requ ct = &ngx_http_image_types[ctx->type - 1]; r->headers_out.content_type_len = ct->len; r->headers_out.content_type = *ct; + r->headers_out.content_type_lowcase = NULL; if (conf->filter == NGX_HTTP_IMAGE_TEST) { ctx->phase = NGX_HTTP_IMAGE_PASS; @@ -502,6 +503,7 @@ ngx_http_image_json(ngx_http_request_t * r->headers_out.status = NGX_HTTP_OK; r->headers_out.content_type.len = sizeof("text/plain") - 1; r->headers_out.content_type.data = (u_char *) "text/plain"; + r->headers_out.content_type_lowcase = NULL; if (ctx == NULL) { b->pos = (u_char *) "{}" CRLF; diff --git a/src/http/modules/ngx_http_range_filter_module.c b/src/http/modules/ngx_http_range_filter_module.c --- a/src/http/modules/ngx_http_range_filter_module.c +++ b/src/http/modules/ngx_http_range_filter_module.c @@ -456,6 +456,8 @@ ngx_http_range_multipart_header(ngx_http return NGX_ERROR; } + r->headers_out.content_type_lowcase = NULL; + /* "Content-Type: multipart/byteranges; boundary=0123456789" */ r->headers_out.content_type.len = @@ -464,6 +466,7 @@ ngx_http_range_multipart_header(ngx_http boundary) - r->headers_out.content_type.data; + r->headers_out.content_type_len = r->headers_out.content_type.len; /* the size of the last boundary CRLF "--0123456789--" CRLF */ diff --git a/src/http/modules/ngx_http_xslt_filter_module.c b/src/http/modules/ngx_http_xslt_filter_module.c --- a/src/http/modules/ngx_http_xslt_filter_module.c +++ b/src/http/modules/ngx_http_xslt_filter_module.c @@ -837,6 +837,8 @@ ngx_http_xslt_apply_stylesheet(ngx_http_ r->headers_out.content_type.data = (u_char *) "text/html"; } + r->headers_out.content_type_lowcase = NULL; + return b; } diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c --- a/src/http/ngx_http_special_response.c +++ b/src/http/ngx_http_special_response.c @@ -610,6 +610,7 @@ ngx_http_send_special_response(ngx_http_ r->headers_out.content_type_len = sizeof("text/html") - 1; r->headers_out.content_type.len = sizeof("text/html") - 1; r->headers_out.content_type.data = (u_char *) "text/html"; + r->headers_out.content_type_lowcase = NULL; } else { r->headers_out.content_length_n = -1; @@ -712,6 +713,7 @@ ngx_http_send_refresh(ngx_http_request_t r->headers_out.content_type_len = sizeof("text/html") - 1; r->headers_out.content_type.len = sizeof("text/html") - 1; r->headers_out.content_type.data = (u_char *) "text/html"; + r->headers_out.content_type_lowcase = NULL; r->headers_out.location->hash = 0; r->headers_out.location = NULL; diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -3174,6 +3174,7 @@ ngx_http_upstream_copy_content_type(ngx_ r->headers_out.content_type_len = h->value.len; r->headers_out.content_type = h->value; + r->headers_out.content_type_lowcase = NULL; for (p = h->value.data; *p; p++) {