mirror of
https://github.com/nginx/nginx.git
synced 2024-11-27 23:49:00 +08:00
reset content_type hash value, this fixes a bug when XSLT responses
could not be processed by SSI, charset, and gzip filters
This commit is contained in:
parent
77fd67cc38
commit
60190068ab
@ -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;
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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++) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user