commit: 1d8eafc0d2c38fdcac34af6b71291e9c8833a20b
parent d24e6eaf391157a1c465d53924189d6cf4bc22e6
Author: Mark Felder <feld@feld.me>
Date: Wed, 30 Jul 2025 10:13:54 -0700
Add failing test case for URL encoding issue
Diffstat:
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/test/pleroma/http_test.exs b/test/pleroma/http_test.exs
@@ -25,6 +25,9 @@ defmodule Pleroma.HTTPTest do
%{method: :post, url: "http://example.com/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)
:ok
@@ -67,4 +70,18 @@ defmodule Pleroma.HTTPTest do
}
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