aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-09-09 11:58:45 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-09-09 11:58:45 +0000
commit316542508b828c787982ee0850dfde9d11238891 (patch)
tree9e7ee105c510a9ffcc1fa97d9bf6634d48eedbe8
parent44b1a127505544aa750dbcd939ac5e7da44cd8ee (diff)
downloadnginx-316542508b828c787982ee0850dfde9d11238891.tar.gz
nginx-316542508b828c787982ee0850dfde9d11238891.zip
strip charset name quotes
-rw-r--r--src/http/ngx_http_upstream.c12
1 files changed, 11 insertions, 1 deletions
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;