diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-05-25 09:06:29 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-05-25 09:06:29 +0000 |
commit | 60190068ab90c5b253c76b94c6c38d0b2489b15c (patch) | |
tree | 8365e9dd5d249b1629b230057312d52e5a6c6467 | |
parent | 77fd67cc3884b29bce6bb40c68e1236e84f7c816 (diff) | |
download | nginx-60190068ab90c5b253c76b94c6c38d0b2489b15c.tar.gz nginx-60190068ab90c5b253c76b94c6c38d0b2489b15c.zip |
reset content_type hash value, this fixes a bug when XSLT responses
could not be processed by SSI, charset, and gzip filters
-rw-r--r-- | src/http/modules/ngx_http_image_filter_module.c | 2 | ||||
-rw-r--r-- | src/http/modules/ngx_http_range_filter_module.c | 3 | ||||
-rw-r--r-- | src/http/modules/ngx_http_xslt_filter_module.c | 2 | ||||
-rw-r--r-- | src/http/ngx_http_special_response.c | 2 | ||||
-rw-r--r-- | src/http/ngx_http_upstream.c | 1 |
5 files changed, 10 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_image_filter_module.c b/src/http/modules/ngx_http_image_filter_module.c index 9d480620e..293a61fc3 100644 --- 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_request_t *r, ngx_chain_t *in) 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, ngx_http_image_filter_ctx_t *ctx) 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 index f708c874b..bc2840831 100644 --- 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_request_t *r, 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_request_t *r, 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 index 220400c83..9703b50ae 100644 --- 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_request_t *r, 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 index 976543034..62f71a3ef 100644 --- 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_request_t *r, 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) 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 index d789d6cb9..eb839e11b 100644 --- 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_http_request_t *r, ngx_table_elt_t *h, 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++) { |