25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

mod_http_upload: Don't add "Server" header line

Administrators can add the "Server" header line using the new listener
option "custom_headers", if desired.
This commit is contained in:
Holger Weiss 2017-03-28 00:03:17 +02:00
parent 191fc1b4e8
commit 510fde58d8

View File

@ -833,7 +833,6 @@ http_response(Host, Code, ExtraHeaders) ->
-> {pos_integer(), [{binary(), binary()}], binary()}. -> {pos_integer(), [{binary(), binary()}], binary()}.
http_response(Host, Code, ExtraHeaders, Body) -> http_response(Host, Code, ExtraHeaders, Body) ->
ServerHeader = {<<"Server">>, <<"ejabberd ", (?VERSION)/binary>>},
CustomHeaders = CustomHeaders =
gen_mod:get_module_opt(Host, ?MODULE, custom_headers, gen_mod:get_module_opt(Host, ?MODULE, custom_headers,
fun(Headers) -> fun(Headers) ->
@ -845,10 +844,9 @@ http_response(Host, Code, ExtraHeaders, Body) ->
[]), []),
Headers = case proplists:is_defined(<<"Content-Type">>, ExtraHeaders) of Headers = case proplists:is_defined(<<"Content-Type">>, ExtraHeaders) of
true -> true ->
[ServerHeader | ExtraHeaders]; ExtraHeaders;
false -> false ->
[ServerHeader, {<<"Content-Type">>, <<"text/plain">>} | [{<<"Content-Type">>, <<"text/plain">>} | ExtraHeaders]
ExtraHeaders]
end ++ CustomHeaders, end ++ CustomHeaders,
{Code, Headers, Body}. {Code, Headers, Body}.