diff options
author | Jakub Witczak <kuba@erlang.org> | 2023-02-17 13:57:35 +0100 |
---|---|---|
committer | Jakub Witczak <kuba@erlang.org> | 2023-02-20 09:17:50 +0100 |
commit | 550d5733b95c088cc63a6db7521b3d1e284909b0 (patch) | |
tree | 19107faf69c7c92c486f1bb5eb9fd2bbb6cc9a55 /lib/inets/src | |
parent | 0863bd30aabd035c83158c78046c5ffda16127e1 (diff) | |
download | erlang-550d5733b95c088cc63a6db7521b3d1e284909b0.tar.gz |
inets: fix httpd and folder URI alias
- for URI pointing to a folder (missing trailing /) with a query component
- insert '/' after patch component but before query
- improve alias test
Diffstat (limited to 'lib/inets/src')
-rw-r--r-- | lib/inets/src/http_server/mod_alias.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/inets/src/http_server/mod_alias.erl b/lib/inets/src/http_server/mod_alias.erl index 94607e705a..c2365484a6 100644 --- a/lib/inets/src/http_server/mod_alias.erl +++ b/lib/inets/src/http_server/mod_alias.erl @@ -66,7 +66,9 @@ do_alias(#mod{config_db = ConfigDB, ServerName = which_server_name(ConfigDB), Port = port_string(which_port(ConfigDB)), Protocol = get_protocol(SocketType), - URL = Protocol ++ ServerName ++ Port ++ ReqURI ++ "/", + {ReqPath, ReqQuery} = httpd_util:split_path(ReqURI), + URL = Protocol ++ ServerName ++ Port ++ ReqPath ++ "/" ++ + ["?" ++ ReqQuery || [] /= ReqQuery], ReasonPhrase = httpd_util:reason_phrase(301), Message = httpd_util:message(301, URL, ConfigDB), {proceed, |