fix(scheme): using uri_string:normalize/1

This commit is contained in:
zhouzb 2021-01-27 18:59:45 +08:00 committed by Zaiming Shi
parent 311df2f8a6
commit 45aafc75dd
1 changed files with 1 additions and 2 deletions

View File

@ -55,8 +55,7 @@ translate_env(EnvName) ->
URL = proplists:get_value(url, Req),
#{host := Host0,
path := Path0,
scheme := Scheme0} = URIMap = uri_string:parse(add_default_scheme(URL)),
Scheme = string:to_lower(Scheme0),
scheme := Scheme} = URIMap = uri_string:parse(uri_string:normalize(add_default_scheme(URL))),
Port = maps:get(port, URIMap, case Scheme of
"https" -> 443;
"http" -> 80