aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_server/mod_alias.erl
diff options
context:
space:
mode:
authorZandra Hird <[email protected]>2015-02-03 11:28:38 +0100
committerZandra Hird <[email protected]>2015-02-03 11:28:38 +0100
commit42d6afe554e11813385dbf175fce58f995c2f9e5 (patch)
treecf80330bfcfea1cb07daf13e50d27d2285fbe8b5 /lib/inets/src/http_server/mod_alias.erl
parent0fee86f864a4ba2a7a363927a50c81c43994ca9a (diff)
parent6c40ea37d6ba97b12c888cc3143fbeacfb5527b0 (diff)
downloadotp-42d6afe554e11813385dbf175fce58f995c2f9e5.tar.gz
otp-42d6afe554e11813385dbf175fce58f995c2f9e5.tar.bz2
otp-42d6afe554e11813385dbf175fce58f995c2f9e5.zip
Merge branch 'maint-17' into maint
Diffstat (limited to 'lib/inets/src/http_server/mod_alias.erl')
-rw-r--r--lib/inets/src/http_server/mod_alias.erl14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/inets/src/http_server/mod_alias.erl b/lib/inets/src/http_server/mod_alias.erl
index 0b9fe4cfe0..5039cd56b5 100644
--- a/lib/inets/src/http_server/mod_alias.erl
+++ b/lib/inets/src/http_server/mod_alias.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -55,6 +55,7 @@ do(#mod{data = Data} = Info) ->
do_alias(#mod{config_db = ConfigDB,
request_uri = ReqURI,
+ socket_type = SocketType,
data = Data}) ->
{ShortPath, Path, AfterPath} =
real_name(ConfigDB, ReqURI, which_alias(ConfigDB)),
@@ -70,8 +71,9 @@ do_alias(#mod{config_db = ConfigDB,
(LastChar =/= $/)) ->
?hdrt("directory and last-char is a /", []),
ServerName = which_server_name(ConfigDB),
- Port = port_string( which_port(ConfigDB) ),
- URL = "http://" ++ ServerName ++ Port ++ ReqURI ++ "/",
+ Port = port_string(which_port(ConfigDB)),
+ Protocol = get_protocol(SocketType),
+ URL = Protocol ++ ServerName ++ Port ++ ReqURI ++ "/",
ReasonPhrase = httpd_util:reason_phrase(301),
Message = httpd_util:message(301, URL, ConfigDB),
{proceed,
@@ -94,6 +96,12 @@ port_string(80) ->
port_string(Port) ->
":" ++ integer_to_list(Port).
+get_protocol(ip_comm) ->
+ "http://";
+get_protocol(_) ->
+ %% Should clean up to have only one ssl type essl vs ssl is not relevant any more
+ "https://".
+
%% real_name
real_name(ConfigDB, RequestURI, []) ->