diff src/http/modules/ngx_http_charset_filter.c @ 139:54307053f185

nginx-0.0.1-2003-10-07-19:30:05 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 07 Oct 2003 15:30:05 +0000
parents b27548f540ad
children 46eb23d9471d
line wrap: on
line diff
--- a/src/http/modules/ngx_http_charset_filter.c
+++ b/src/http/modules/ngx_http_charset_filter.c
@@ -60,8 +60,13 @@ static int ngx_http_charset_header_filte
 {
     ngx_http_charset_loc_conf_t  *lcf;
 
-    if (ngx_strncasecmp(r->headers_out.content_type->value.data, "text/", 5)
-                                                                        != 0) {
+    if (r->headers_out.content_type == NULL
+        || ngx_strncasecmp(r->headers_out.content_type->value.data,
+                                                           "text/", 5) != 0
+        || ngx_strstr(r->headers_out.content_type->value.data, "charset")
+                                                                       != NULL
+       )
+    {
         return next_header_filter(r);
     }