diff options
author | Ingela Anderton Andin <[email protected]> | 2017-08-17 12:15:04 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2017-09-12 15:13:06 +0200 |
commit | 4e1b1fd249c07676823513cad7f3845a8b9bbe95 (patch) | |
tree | 26ad28beb3b7228485f37d774151a4eb316f4e5d /lib/inets/src | |
parent | 5d01c70ca399edf28e99dc760506329689fab6ba (diff) | |
download | otp-4e1b1fd249c07676823513cad7f3845a8b9bbe95.tar.gz otp-4e1b1fd249c07676823513cad7f3845a8b9bbe95.tar.bz2 otp-4e1b1fd249c07676823513cad7f3845a8b9bbe95.zip |
inets: httpd correct server_name environment value
Add host_name to hold the resolved name incorrectly provided as server
name before.
Diffstat (limited to 'lib/inets/src')
-rw-r--r-- | lib/inets/src/http_server/httpd_script_env.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/inets/src/http_server/httpd_script_env.erl b/lib/inets/src/http_server/httpd_script_env.erl index e15613273e..055f08fdb0 100644 --- a/lib/inets/src/http_server/httpd_script_env.erl +++ b/lib/inets/src/http_server/httpd_script_env.erl @@ -74,9 +74,13 @@ which_peercert(#mod{socket_type = {Type, _}, socket = Socket}) when Type == essl which_peercert(_) -> %% Not an ssl connection undefined. + which_resolve(#mod{init_data = #init_data{resolve = Resolve}}) -> Resolve. +which_name(#mod{config_db = ConfigDB}) -> + httpd_util:lookup(ConfigDB, server_name). + which_method(#mod{method = Method}) -> Method. @@ -85,7 +89,8 @@ which_request_uri(#mod{request_uri = RUri}) -> create_basic_elements(esi, ModData) -> [{server_software, which_server(ModData)}, - {server_name, which_resolve(ModData)}, + {server_name, which_name(ModData)}, + {host_name, which_resolve(ModData)}, {gateway_interface, ?GATEWAY_INTERFACE}, {server_protocol, ?SERVER_PROTOCOL}, {server_port, which_port(ModData)}, @@ -96,7 +101,8 @@ create_basic_elements(esi, ModData) -> create_basic_elements(cgi, ModData) -> [{"SERVER_SOFTWARE", which_server(ModData)}, - {"SERVER_NAME", which_resolve(ModData)}, + {"SERVER_NAME", which_name(ModData)}, + {"HOST_NAME", which_resolve(ModData)}, {"GATEWAY_INTERFACE", ?GATEWAY_INTERFACE}, {"SERVER_PROTOCOL", ?SERVER_PROTOCOL}, {"SERVER_PORT", integer_to_list(which_port(ModData))}, |