From 7e080678d61d946891c035d79b73715f1cc57682 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 31 Jan 2017 12:09:40 +0300 Subject: Implemented the "server_tokens build" option. Based on a patch by Tom Thorogood. --- src/http/ngx_http_special_response.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/http/ngx_http_special_response.c') 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[] = +"
" NGINX_VER_BUILD "
" CRLF +"" CRLF +"" CRLF +; + + static u_char ngx_http_error_tail[] = "
nginx
" CRLF "" 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; -- cgit