]> git.kaiwu.me - nginx.git/commitdiff
strip charset name quotes
authorIgor Sysoev <igor@sysoev.ru>
Tue, 9 Sep 2008 11:58:45 +0000 (11:58 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 9 Sep 2008 11:58:45 +0000 (11:58 +0000)
src/http/ngx_http_upstream.c

index ae86b98586dcca719085fe2c722081bdbbf0397d..6bbf872c1ad94f213dd2953342e1d2be6140311c 100644 (file)
@@ -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;