Mercurial > hg > nginx
comparison src/http/ngx_http_special_response.c @ 6885:25203fc377fb
Implemented the "server_tokens build" option.
Based on a patch by Tom Thorogood.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Tue, 31 Jan 2017 12:09:40 +0300 |
parents | 92ad1c92bcf9 |
children | 3ef4cadfad7f |
comparison
equal
deleted
inserted
replaced
6884:640f03529395 | 6885:25203fc377fb |
---|---|
18 static ngx_int_t ngx_http_send_refresh(ngx_http_request_t *r); | 18 static ngx_int_t ngx_http_send_refresh(ngx_http_request_t *r); |
19 | 19 |
20 | 20 |
21 static u_char ngx_http_error_full_tail[] = | 21 static u_char ngx_http_error_full_tail[] = |
22 "<hr><center>" NGINX_VER "</center>" CRLF | 22 "<hr><center>" NGINX_VER "</center>" CRLF |
23 "</body>" CRLF | |
24 "</html>" CRLF | |
25 ; | |
26 | |
27 | |
28 static u_char ngx_http_error_build_tail[] = | |
29 "<hr><center>" NGINX_VER_BUILD "</center>" CRLF | |
23 "</body>" CRLF | 30 "</body>" CRLF |
24 "</html>" CRLF | 31 "</html>" CRLF |
25 ; | 32 ; |
26 | 33 |
27 | 34 |
626 ngx_int_t rc; | 633 ngx_int_t rc; |
627 ngx_buf_t *b; | 634 ngx_buf_t *b; |
628 ngx_uint_t msie_padding; | 635 ngx_uint_t msie_padding; |
629 ngx_chain_t out[3]; | 636 ngx_chain_t out[3]; |
630 | 637 |
631 if (clcf->server_tokens) { | 638 if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_ON) { |
632 len = sizeof(ngx_http_error_full_tail) - 1; | 639 len = sizeof(ngx_http_error_full_tail) - 1; |
633 tail = ngx_http_error_full_tail; | 640 tail = ngx_http_error_full_tail; |
641 | |
642 } else if (clcf->server_tokens == NGX_HTTP_SERVER_TOKENS_BUILD) { | |
643 len = sizeof(ngx_http_error_build_tail) - 1; | |
644 tail = ngx_http_error_build_tail; | |
634 | 645 |
635 } else { | 646 } else { |
636 len = sizeof(ngx_http_error_tail) - 1; | 647 len = sizeof(ngx_http_error_tail) - 1; |
637 tail = ngx_http_error_tail; | 648 tail = ngx_http_error_tail; |
638 } | 649 } |