]> git.kaiwu.me - nginx.git/commitdiff
reset content_type hash value, this fixes a bug when XSLT responses
authorIgor Sysoev <igor@sysoev.ru>
Mon, 25 May 2009 09:06:29 +0000 (09:06 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 25 May 2009 09:06:29 +0000 (09:06 +0000)
could not be processed by SSI, charset, and gzip filters

src/http/modules/ngx_http_image_filter_module.c
src/http/modules/ngx_http_range_filter_module.c
src/http/modules/ngx_http_xslt_filter_module.c
src/http/ngx_http_special_response.c
src/http/ngx_http_upstream.c

index 9d480620e142617d153a2af1074b74348146cb28..293a61fc37b84e7fd063dbe946ed8d65725bda8a 100644 (file)
@@ -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;
index f708c874b72f7fd4da9aff6d585250cf32acc88a..bc2840831e5c3511c1e1016891fc578140e19b8a 100644 (file)
@@ -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 */
 
index 220400c83b0149617fc11412800205ecea805f0e..9703b50aed8a345d75d437f80225fe07d846d86e 100644 (file)
@@ -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;
 }
 
index 976543034cc28f1fcab9ad772319ff9fb8a63a59..62f71a3ef7e72503e5b7adce94cb979f73802b65 100644 (file)
@@ -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;
index d789d6cb9c1fcce812de2f24ed02cb7be06c9949..eb839e11b75724dcc4442a940b2bebf7ef90f158 100644 (file)
@@ -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++) {