From 316542508b828c787982ee0850dfde9d11238891 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 9 Sep 2008 11:58:45 +0000 Subject: [PATCH] strip charset name quotes --- src/http/ngx_http_upstream.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index ae86b9858..6bbf872c1 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2632,7 +2632,17 @@ ngx_http_upstream_copy_content_type(ngx_http_request_t *r, ngx_table_elt_t *h, r->headers_out.content_type_len = last - h->value.data; - r->headers_out.charset.len = h->value.data + h->value.len - p; + if (*p == '"') { + p++; + } + + last = h->value.data + h->value.len; + + if (*(last - 1) == '"') { + last--; + } + + r->headers_out.charset.len = last - p; r->headers_out.charset.data = p; return NGX_OK;