diff options
author | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-03-10 15:54:11 +0300 |
---|---|---|
committer | Alexander Strizhakov <alex.strizhakov@gmail.com> | 2020-03-10 15:54:11 +0300 |
commit | f39e1b9eff859c0795911212c59304f68fca92bc (patch) | |
tree | e8dca516bef06be657389571fdc518480167431f /test/http/connection_test.exs | |
parent | 426f5ee48a09dbf321c013db08cc849c8929d86d (diff) | |
download | pleroma-f39e1b9eff859c0795911212c59304f68fca92bc.tar.gz |
add verify tls_opts only when we open connection
for other requests tesla will add tls_opts
Diffstat (limited to 'test/http/connection_test.exs')
-rw-r--r-- | test/http/connection_test.exs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/http/connection_test.exs b/test/http/connection_test.exs index 25a2bac1c..0f62eddd2 100644 --- a/test/http/connection_test.exs +++ b/test/http/connection_test.exs @@ -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 |