aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server/httpd_response.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2015-04-16 16:40:06 +0200
committerHans Nilsson <[email protected]>2015-04-21 09:29:02 +0200
commitab9c37a30c960cbc5e5b72c73a3a315afc4c3920 (patch)
tree7f9934080ba0551c6b6a42f7b3a7c294b6efe972 /lib/inets/src/http_server/httpd_response.erl
parentbbac1019905e6e493a2cd3c8463e53a818d0723d (diff)
downloadotp-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.erl7
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).