add verify tls_opts only when we open connection

for other requests tesla will add tls_opts
This commit is contained in:
Alexander Strizhakov 2020-03-10 15:54:11 +03:00
commit f39e1b9eff
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
5 changed files with 66 additions and 60 deletions

View file

@ -113,4 +113,23 @@ defmodule Pleroma.HTTP.ConnectionTest do
assert opts[:proxy] == {'example.com', 4321}
end
end
describe "format_host/1" do
test "with domain" do
assert Connection.format_host("example.com") == 'example.com'
end
test "with idna domain" do
assert Connection.format_host("ですexample.com") == 'xn--example-183fne.com'
end
test "with ipv4" do
assert Connection.format_host("127.0.0.1") == '127.0.0.1'
end
test "with ipv6" do
assert Connection.format_host("2a03:2880:f10c:83:face:b00c:0:25de") ==
'2a03:2880:f10c:83:face:b00c:0:25de'
end
end
end