moving some logic to tesla adapter

- checking original inside gun adapter
- flushing streams on max_body error
This commit is contained in:
Alexander Strizhakov 2020-03-04 18:13:24 +03:00
commit d6bebd4f9c
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
6 changed files with 6 additions and 34 deletions

View file

@ -35,8 +35,6 @@ defmodule Pleroma.HTTP.AdapterHelper.GunTest do
{&:ssl_verify_hostname.verify_fun/3, [check_hostname: 'example.com']}
assert File.exists?(tls_opts[:cacertfile])
assert opts[:original] == "example.com:443"
end
test "https ipv4 with default port" do
@ -46,8 +44,6 @@ defmodule Pleroma.HTTP.AdapterHelper.GunTest do
assert opts[:tls_opts][:verify_fun] ==
{&:ssl_verify_hostname.verify_fun/3, [check_hostname: '127.0.0.1']}
assert opts[:original] == "127.0.0.1:443"
end
test "https ipv6 with default port" do
@ -58,8 +54,6 @@ defmodule Pleroma.HTTP.AdapterHelper.GunTest do
assert opts[:tls_opts][:verify_fun] ==
{&:ssl_verify_hostname.verify_fun/3,
[check_hostname: '2a03:2880:f10c:83:face:b00c:0:25de']}
assert opts[:original] == "2a03:2880:f10c:83:face:b00c:0:25de:443"
end
test "https url with non standart port" do
@ -129,7 +123,6 @@ defmodule Pleroma.HTTP.AdapterHelper.GunTest do
assert tls_opts[:depth] == 20
assert tls_opts[:reuse_sessions] == false
assert opts[:original] == "some-domain.com:443"
assert opts[:close_conn] == false
assert is_pid(opts[:conn])
end

View file

@ -134,7 +134,6 @@ defmodule Pleroma.HTTP.ConnectionTest do
assert tls_opts[:depth] == 20
assert tls_opts[:reuse_sessions] == false
assert opts[:original] == "some-domain.com:443"
assert opts[:close_conn] == false
assert is_pid(opts[:conn])
end