comparison src/http/ngx_http_special_response.c @ 6449:e5076b96fd01

Reconsidered server_tokens with an empty value. An empty value will be treated as "off".
author Ruslan Ermilov <ru@nginx.com>
date Tue, 22 Mar 2016 15:52:28 +0300
parents cf3e75cfa951
children 155871d773cc
comparison
equal deleted inserted replaced
6448:4d1d3c2530e0 6449:e5076b96fd01
25 ; 25 ;
26 26
27 27
28 static u_char ngx_http_error_tail[] = 28 static u_char ngx_http_error_tail[] =
29 "<hr><center>nginx</center>" CRLF 29 "<hr><center>nginx</center>" CRLF
30 "</body>" CRLF
31 "</html>" CRLF
32 ;
33
34
35 static u_char ngx_http_error_no_tail[] =
36 "</body>" CRLF 30 "</body>" CRLF
37 "</html>" CRLF 31 "</html>" CRLF
38 ; 32 ;
39 33
40 34
636 != NGX_OK) 630 != NGX_OK)
637 { 631 {
638 return NGX_ERROR; 632 return NGX_ERROR;
639 } 633 }
640 634
641 if (tokens.len == 3 635 if (tokens.len == 0
642 && ngx_strncmp(tokens.data, "off", 3) == 0) 636 || (tokens.len == 3 && ngx_strncmp(tokens.data, "off", 3) == 0))
643 { 637 {
644 ngx_str_set(&tail, ngx_http_error_tail); 638 ngx_str_set(&tail, ngx_http_error_tail);
645 639
646 } else if (tokens.len) { 640 } else {
647 ngx_str_set(&tail, ngx_http_error_full_tail); 641 ngx_str_set(&tail, ngx_http_error_full_tail);
648
649 } else {
650 ngx_str_set(&tail, ngx_http_error_no_tail);
651 } 642 }
652 } 643 }
653 644
654 r->headers_out.content_length_n = ngx_http_error_pages[err].len 645 r->headers_out.content_length_n = ngx_http_error_pages[err].len
655 + tail.len; 646 + tail.len;