diff options
| author | Ruslan Ermilov <ru@nginx.com> | 2016-03-22 15:52:28 +0300 |
|---|---|---|
| committer | Ruslan Ermilov <ru@nginx.com> | 2016-03-22 15:52:28 +0300 |
| commit | 0b768c143594706d1fb99fbe842d27de375bd5be (patch) | |
| tree | 301df3aeb408a6048dea30c903b8b9c74f09f260 /src/http/ngx_http_special_response.c | |
| parent | ae5e76ea06380be3b9191a3ce11f3e86e8878019 (diff) | |
| download | nginx-0b768c143594706d1fb99fbe842d27de375bd5be.tar.gz nginx-0b768c143594706d1fb99fbe842d27de375bd5be.tar.bz2 | |
Reconsidered server_tokens with an empty value.
An empty value will be treated as "off".
Diffstat (limited to '')
| -rw-r--r-- | src/http/ngx_http_special_response.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c index 7987309a6..70fdf440d 100644 --- a/src/http/ngx_http_special_response.c +++ b/src/http/ngx_http_special_response.c @@ -32,12 +32,6 @@ static u_char ngx_http_error_tail[] = ; -static u_char ngx_http_error_no_tail[] = -"</body>" CRLF -"</html>" CRLF -; - - static u_char ngx_http_msie_padding[] = "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF "<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF @@ -638,16 +632,13 @@ ngx_http_send_special_response(ngx_http_request_t *r, return NGX_ERROR; } - if (tokens.len == 3 - && ngx_strncmp(tokens.data, "off", 3) == 0) + if (tokens.len == 0 + || (tokens.len == 3 && ngx_strncmp(tokens.data, "off", 3) == 0)) { ngx_str_set(&tail, ngx_http_error_tail); - } else if (tokens.len) { - ngx_str_set(&tail, ngx_http_error_full_tail); - } else { - ngx_str_set(&tail, ngx_http_error_no_tail); + ngx_str_set(&tail, ngx_http_error_full_tail); } } |
