comparison src/http/ngx_http_header_filter_module.c @ 5382:e8d24b6d7f73

Fixed response line formatting with empty reason phrase. As per RFC 2616 sec 6.1 the response status code is always followed by SP.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 18 Sep 2013 18:53:26 +0400
parents 907f01a2a7c0
children cf3e75cfa951
comparison
equal deleted inserted replaced
5381:3adbd23bf79e 5382:e8d24b6d7f73
262 262
263 status_line = &ngx_http_status_lines[status]; 263 status_line = &ngx_http_status_lines[status];
264 len += ngx_http_status_lines[status].len; 264 len += ngx_http_status_lines[status].len;
265 265
266 } else { 266 } else {
267 len += NGX_INT_T_LEN; 267 len += NGX_INT_T_LEN + 1 /* SP */;
268 status_line = NULL; 268 status_line = NULL;
269 } 269 }
270 270
271 if (status_line && status_line->len == 0) { 271 if (status_line && status_line->len == 0) {
272 status = r->headers_out.status; 272 status = r->headers_out.status;
273 len += NGX_INT_T_LEN; 273 len += NGX_INT_T_LEN + 1 /* SP */;
274 status_line = NULL; 274 status_line = NULL;
275 } 275 }
276 } 276 }
277 277
278 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 278 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
449 /* status line */ 449 /* status line */
450 if (status_line) { 450 if (status_line) {
451 b->last = ngx_copy(b->last, status_line->data, status_line->len); 451 b->last = ngx_copy(b->last, status_line->data, status_line->len);
452 452
453 } else { 453 } else {
454 b->last = ngx_sprintf(b->last, "%03ui", status); 454 b->last = ngx_sprintf(b->last, "%03ui ", status);
455 } 455 }
456 *b->last++ = CR; *b->last++ = LF; 456 *b->last++ = CR; *b->last++ = LF;
457 457
458 if (r->headers_out.server == NULL) { 458 if (r->headers_out.server == NULL) {
459 if (clcf->server_tokens) { 459 if (clcf->server_tokens) {