diff options
author | Hans Nilsson <[email protected]> | 2015-04-16 16:40:06 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2015-04-21 09:29:02 +0200 |
commit | ab9c37a30c960cbc5e5b72c73a3a315afc4c3920 (patch) | |
tree | 7f9934080ba0551c6b6a42f7b3a7c294b6efe972 /lib/inets/src/http_server/httpd_response.erl | |
parent | bbac1019905e6e493a2cd3c8463e53a818d0723d (diff) | |
download | otp-ab9c37a30c960cbc5e5b72c73a3a315afc4c3920.tar.gz otp-ab9c37a30c960cbc5e5b72c73a3a315afc4c3920.tar.bz2 otp-ab9c37a30c960cbc5e5b72c73a3a315afc4c3920.zip |
inets: Add value 'none' in server_tokens config
When the Server header has empty info (or 'none' in config), it is not generated. This is for limiting Banner Grabbing attempts.
Diffstat (limited to 'lib/inets/src/http_server/httpd_response.erl')
-rw-r--r-- | lib/inets/src/http_server/httpd_response.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/inets/src/http_server/httpd_response.erl b/lib/inets/src/http_server/httpd_response.erl index 0895729d05..2fa91d47a0 100644 --- a/lib/inets/src/http_server/httpd_response.erl +++ b/lib/inets/src/http_server/httpd_response.erl @@ -287,8 +287,11 @@ create_header(ConfigDb, KeyValueTupleHeaders) -> ContentType = "text/html", Server = server(ConfigDb), NewHeaders = add_default_headers([{"date", Date}, - {"content-type", ContentType}, - {"server", Server}], + {"content-type", ContentType} + | if Server=="" -> []; + true -> [{"server", Server}] + end + ], KeyValueTupleHeaders), lists:map(fun fix_header/1, NewHeaders). |