Add failing test case for URL encoding issue
This commit is contained in:
parent
d24e6eaf39
commit
1d8eafc0d2
1 changed files with 17 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue