aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/misc.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/misc.erl b/src/misc.erl
index 2574c005a..85d11da4a 100644
--- a/src/misc.erl
+++ b/src/misc.erl
@@ -65,8 +65,14 @@ uri_parse(URL) ->
uri_parse(URL) when is_binary(URL) ->
uri_parse(binary_to_list(URL));
uri_parse(URL) ->
- #{scheme:=Scheme,host:=Host,port:=Port,path:=Path} = uri_string:parse(URL),
- {ok, Scheme, Host, Port, Path}.
+ case uri_string:parse(URL) of
+ #{scheme := Scheme, host := Host, port := Port, path := Path} ->
+ {ok, Scheme, Host, Port, Path};
+ #{scheme := "https", host := Host, path := Path} ->
+ {ok, "https", Host, 443, Path};
+ #{scheme := "http", host := Host, path := Path} ->
+ {ok, "http", Host, 80, Path}
+ end.
-endif.
-ifdef(USE_OLD_CRYPTO_HMAC).