Fixed response line formatting with empty reason phrase.
As per RFC 2616 sec 6.1 the response status code is always followed by SP.
diff --git a/src/http/ngx_http_header_filter_module.c b/src/http/ngx_http_header_filter_module.c
index fc54836..507dc93 100644
--- a/src/http/ngx_http_header_filter_module.c
+++ b/src/http/ngx_http_header_filter_module.c
@@ -264,13 +264,13 @@
len += ngx_http_status_lines[status].len;
} else {
- len += NGX_INT_T_LEN;
+ len += NGX_INT_T_LEN + 1 /* SP */;
status_line = NULL;
}
if (status_line && status_line->len == 0) {
status = r->headers_out.status;
- len += NGX_INT_T_LEN;
+ len += NGX_INT_T_LEN + 1 /* SP */;
status_line = NULL;
}
}
@@ -451,7 +451,7 @@
b->last = ngx_copy(b->last, status_line->data, status_line->len);
} else {
- b->last = ngx_sprintf(b->last, "%03ui", status);
+ b->last = ngx_sprintf(b->last, "%03ui ", status);
}
*b->last++ = CR; *b->last++ = LF;