If server_tokens is disabled remove the Server header (#1903)

* If server_tokens is disabled remove the Server header

* Add server-tokens tests

* Fix tests
This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-01-17 10:26:53 -02:00 committed by GitHub
parent 3e7d1f9acf
commit 807932259e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 145 additions and 1 deletions

View file

@ -135,6 +135,9 @@ http {
{{ end }}
server_tokens {{ if $cfg.ShowServerTokens }}on{{ else }}off{{ end }};
{{ if not $cfg.ShowServerTokens }}
more_set_headers "Server: ";
{{ end }}
# disable warnings
uninitialized_variable_warn off;