Рефакторинг обработчиков. Финальное тестирование #21

This commit is contained in:
2026-05-18 14:37:59 +03:00
parent 40806df62a
commit 3abf5c94ee
21 changed files with 630 additions and 89 deletions

View File

@@ -237,10 +237,19 @@ extract_port(Url) ->
[_, PortStr] -> {ok, list_to_integer(PortStr)};
_ -> case string:split(Rest, "://", trailing) of
[_, R] -> extract_port("https://" ++ R);
_ -> {ok, 80}
_ -> {ok, default_port(Url)}
end
end;
_ -> {ok, 80}
_ -> {ok, default_port(Url)}
end.
default_port(Url) ->
case string:prefix(Url, "wss://") of
nomatch -> case string:prefix(Url, "ws://") of
nomatch -> 80;
_ -> 80
end;
_ -> 443
end.
extract_host(Url) ->