diff src/http/ngx_http_special_response.c @ 3516:dd1570b6f237

ngx_str_set() and ngx_str_null()
author Igor Sysoev <igor@sysoev.ru>
date Fri, 14 May 2010 09:56:37 +0000
parents a63dd08379c4
children 84905c7b2aa7
line wrap: on
line diff
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -553,8 +553,7 @@ ngx_http_send_error_page(ngx_http_reques
     r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
 
     location->hash = 1;
-    location->key.len = sizeof("Location") - 1;
-    location->key.data = (u_char *) "Location";
+    ngx_str_set(&location->key, "Location");
     location->value = uri;
 
     r->headers_out.location = location;
@@ -608,8 +607,7 @@ ngx_http_send_special_response(ngx_http_
             }
 
             r->headers_out.content_type_len = sizeof("text/html") - 1;
-            r->headers_out.content_type.len = sizeof("text/html") - 1;
-            r->headers_out.content_type.data = (u_char *) "text/html";
+            ngx_str_set(&r->headers_out.content_type, "text/html");
             r->headers_out.content_type_lowcase = NULL;
 
         } else {
@@ -711,8 +709,7 @@ ngx_http_send_refresh(ngx_http_request_t
     r->err_status = NGX_HTTP_OK;
 
     r->headers_out.content_type_len = sizeof("text/html") - 1;
-    r->headers_out.content_type.len = sizeof("text/html") - 1;
-    r->headers_out.content_type.data = (u_char *) "text/html";
+    ngx_str_set(&r->headers_out.content_type, "text/html");
     r->headers_out.content_type_lowcase = NULL;
 
     r->headers_out.location->hash = 0;