mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
mastodon_websocket_test.exs: Test for Sec-WebSocket-Protocol header
This commit is contained in:
parent
e174614eb9
commit
b5ba41a725
1 changed files with 7 additions and 0 deletions
|
@ -107,5 +107,12 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do
|
||||||
assert {:ok, _} = start_socket("?stream=user:notification&access_token=#{token.token}")
|
assert {:ok, _} = start_socket("?stream=user:notification&access_token=#{token.token}")
|
||||||
assert {:error, {403, "Forbidden"}} = start_socket("?stream=user:notification")
|
assert {:error, {403, "Forbidden"}} = start_socket("?stream=user:notification")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "accepts valid token on Sec-WebSocket-Protocol header", %{token: token} do
|
||||||
|
assert {:ok, _} = start_socket("?stream=user", [{"Sec-WebSocket-Protocol", token.token}])
|
||||||
|
|
||||||
|
assert {:error, {403, "Forbidden"}} =
|
||||||
|
start_socket("?stream=user", [{"Sec-WebSocket-Protocol", "I am a friend"}])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue