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