mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-29 16:56:52 +00:00
mastodon_websocket_test.exs: Test for Sec-WebSocket-Protocol header
This commit is contained in:
parent
e174614eb9
commit
b5ba41a725
|
@ -107,5 +107,12 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do
|
|||
assert {:ok, _} = start_socket("?stream=user:notification&access_token=#{token.token}")
|
||||
assert {:error, {403, "Forbidden"}} = start_socket("?stream=user:notification")
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue