Add failing test case for URL encoding issue

This commit is contained in:
Mark Felder 2025-07-30 10:13:54 -07:00
commit 1d8eafc0d2

View file

@ -25,6 +25,9 @@ defmodule Pleroma.HTTPTest do
%{method: :post, url: "http://example.com/world"} -> %{method: :post, url: "http://example.com/world"} ->
%Tesla.Env{status: 200, body: "world"} %Tesla.Env{status: 200, body: "world"}
%{method: :get, url: "https://tsundere.love/emoji/Pack%201/koronebless.png"} ->
%Tesla.Env{status: 200, body: "emoji data"}
end) end)
:ok :ok
@ -67,4 +70,18 @@ defmodule Pleroma.HTTPTest do
} }
end end
end end
test "URL encoding properly encodes URLs with spaces" do
url_with_space = "https://tsundere.love/emoji/Pack 1/koronebless.png"
result = HTTP.get(url_with_space)
assert result == {:ok, %Tesla.Env{status: 200, body: "emoji data"}}
properly_encoded_url = "https://tsundere.love/emoji/Pack%201/koronebless.png"
result = HTTP.get(properly_encoded_url)
assert result == {:ok, %Tesla.Env{status: 200, body: "emoji data"}}
end
end end