aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex S <alex.strizhakov@gmail.com>2019-08-14 20:08:15 +0300
committerAlex S <alex.strizhakov@gmail.com>2019-08-20 12:41:45 +0300
commit916aeb934f4a961948ba41f9ac9c0f52d986600f (patch)
tree62d23fd660c9501d17a576d5347c81c21a03d6c6 /test
parent59336f14482c369c6c3a7bbc621d0a2828fd577f (diff)
downloadpleroma-916aeb934f4a961948ba41f9ac9c0f52d986600f.tar.gz
adding host header for gun adapter
Diffstat (limited to 'test')
-rw-r--r--test/http/request_builder_test.exs13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/http/request_builder_test.exs b/test/http/request_builder_test.exs
index ea4dd087e..631730f65 100644
--- a/test/http/request_builder_test.exs
+++ b/test/http/request_builder_test.exs
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.HTTP.RequestBuilderTest do
- use ExUnit.Case, async: true
+ use ExUnit.Case
use Pleroma.Tests.Helpers
alias Pleroma.HTTP.RequestBuilder
@@ -21,6 +21,17 @@ defmodule Pleroma.HTTP.RequestBuilderTest do
headers: [{"user-agent", Pleroma.Application.user_agent()}]
}
end
+
+ test "it adds host header for gun adapter" do
+ adapter = Application.get_env(:tesla, :adapter)
+ Application.put_env(:tesla, :adapter, Tesla.Adapter.Gun)
+ on_exit(fn -> Application.put_env(:tesla, :adapter, adapter) end)
+
+ assert RequestBuilder.headers(%{url: "https://example.com"}, []) == %{
+ headers: [{"host", "example.com"}],
+ url: "https://example.com"
+ }
+ end
end
describe "add_optional_params/3" do