summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_special_response.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2017-01-31 12:09:40 +0300
committerRuslan Ermilov <ru@nginx.com>2017-01-31 12:09:40 +0300
commit7e080678d61d946891c035d79b73715f1cc57682 (patch)
tree75766deeb10783d398c12511e4ff07b9cb727c21 /src/http/ngx_http_special_response.c
parent10c43d8e81582cf0510e74126069fe081353b2a5 (diff)
downloadnginx-7e080678d61d946891c035d79b73715f1cc57682.tar.gz
nginx-7e080678d61d946891c035d79b73715f1cc57682.tar.bz2
Implemented the "server_tokens build" option.
Based on a patch by Tom Thorogood.
Diffstat (limited to 'src/http/ngx_http_special_response.c')
-rw-r--r--src/http/ngx_http_special_response.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c
index d4c39ff65..9de0d15aa 100644
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -25,6 +25,13 @@ static u_char ngx_http_error_full_tail[] =
;
+static u_char ngx_http_error_build_tail[] =
+"<hr><center>" NGINX_VER_BUILD "</center>" CRLF
+"</body>" CRLF
+"</html>" CRLF
+;
+
+
static u_char ngx_http_error_tail[] =
"<hr><center>nginx</center>" CRLF
"</body>" CRLF
@@ -628,10 +635,14 @@ ngx_http_send_special_response(ngx_http_request_t *r,
ngx_uint_t msie_padding;
ngx_chain_t out[3];
- if (clcf->server_tokens) {
+ if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) {
len = sizeof(ngx_http_error_full_tail) - 1;
tail = ngx_http_error_full_tail;
+ } else if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_BUILD) {
+ len = sizeof(ngx_http_error_build_tail) - 1;
+ tail = ngx_http_error_build_tail;
+
} else {
len = sizeof(ngx_http_error_tail) - 1;
tail = ngx_http_error_tail;