Skip to content

Commit 72783fb

Browse files
committed
deps: bump idna to 7.1.0, remove string_compat usage
- Update idna dependency from 6.1.0 to 7.1.0 - Replace string_compat:to_lower/1 with string:lowercase/1 - Replace string_compat:strip/3 with string:trim/3 string_compat was provided by the old idna/unicode_util_compat stack and is no longer needed with modern Erlang stdlib.
1 parent 3bbec80 commit 72783fb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

rebar.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
]}.
4646

4747
{deps, [
48-
{idna, "~>6.1.0"},
48+
{idna, "~>7.1.0"},
4949
{mimerl, "~>1.4"},
5050
{certifi, "~>2.15.0"},
5151
{parse_trans, "3.4.1"},

src/hackney_pool.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ handle_call({count, Key}, _From, #state{available=Available}=State) ->
426426

427427
handle_call({host_stats, Host, Port}, _From, #state{available=Available, in_use=InUse}=State) ->
428428
%% Count in_use and free for this host (any transport)
429-
HostLower = string_compat:to_lower(Host),
429+
HostLower = string:lowercase(Host),
430430
InUseCount = maps:fold(
431431
fun(_Pid, {H, P, _T}, Acc) when H =:= HostLower, P =:= Port -> Acc + 1;
432432
(_, _, Acc) -> Acc
@@ -708,7 +708,7 @@ terminate(_Reason, #state{name=PoolName, available=Available,
708708
%%====================================================================
709709

710710
connection_key(Host0, Port, Transport) ->
711-
Host = string_compat:to_lower(Host0),
711+
Host = string:lowercase(Host0),
712712
{Host, Port, Transport}.
713713

714714
find_available(Key, Available) ->

src/hackney_ssl.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ merge_ssl_opts(Host, OverrideOpts, Options) ->
8181

8282

8383
check_hostname_opts(Host0) ->
84-
Host1 = string_compat:strip(Host0, right, $.),
84+
Host1 = string:trim(Host0, trailing, "."),
8585
VerifyFun = {
8686
fun ssl_verify_hostname:verify_fun/3,
8787
[{check_hostname, Host1}]

0 commit comments

Comments
 (0)