diff src/http/ngx_http_special_response.c @ 71:59229033ae93

nginx-0.0.1-2003-04-08-19:40:10 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 08 Apr 2003 15:40:10 +0000
parents e43f406e4525
children 674d333f4296
line wrap: on
line diff
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -122,11 +122,22 @@ int ngx_http_special_response_handler(ng
     if (error < NGX_HTTP_BAD_REQUEST) {
         err = error - NGX_HTTP_MOVED_PERMANENTLY;
 
-    } else if (error < NGX_HTTP_INTERNAL_SERVER_ERROR) {
-        err = error - NGX_HTTP_BAD_REQUEST + 3;
+    } else {
+        ngx_test_null(r->headers_out.content_type,
+                      ngx_push_table(r->headers_out.headers),
+                      NGX_HTTP_INTERNAL_SERVER_ERROR);
 
-    } else {
-        err = error - NGX_HTTP_INTERNAL_SERVER_ERROR + 3 + 17;
+        r->headers_out.content_type->key.len = 12;
+        r->headers_out.content_type->key.data = "Content-Type";
+        r->headers_out.content_type->value.len = 9;
+        r->headers_out.content_type->value.data = "text/html";
+
+        if (error < NGX_HTTP_INTERNAL_SERVER_ERROR) {
+            err = error - NGX_HTTP_BAD_REQUEST + 3;
+
+        } else {
+            err = error - NGX_HTTP_INTERNAL_SERVER_ERROR + 3 + 17;
+        }
     }
 
     if (r->keepalive != 0) {