aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server/httpd_script_env.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2017-09-13 10:36:06 +0200
committerErlang/OTP <[email protected]>2017-09-13 10:36:06 +0200
commit6f09e2fe50a614fcc368c17410a23498f0cc2d6a (patch)
tree26ad28beb3b7228485f37d774151a4eb316f4e5d /lib/inets/src/http_server/httpd_script_env.erl
parenta230f26086b3db9097f06d4bb91fb3b2e9379c77 (diff)
parent4e1b1fd249c07676823513cad7f3845a8b9bbe95 (diff)
downloadotp-6f09e2fe50a614fcc368c17410a23498f0cc2d6a.tar.gz
otp-6f09e2fe50a614fcc368c17410a23498f0cc2d6a.tar.bz2
otp-6f09e2fe50a614fcc368c17410a23498f0cc2d6a.zip
Merge branch 'ingela/inets/httpd-chunk-post/OTP-14450' into maint-20
* ingela/inets/httpd-chunk-post/OTP-14450: inets: httpd correct server_name environment value inets: httpd - Add chunk handling of client data
Diffstat (limited to 'lib/inets/src/http_server/httpd_script_env.erl')
-rw-r--r--lib/inets/src/http_server/httpd_script_env.erl10
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))},