summaryrefslogtreecommitdiff
path: root/test/integration/mastodon_websocket_test.exs
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2019-07-09 12:49:04 -0500
committerMark Felder <feld@FreeBSD.org>2019-07-09 12:49:04 -0500
commit9a9b60cfbcbcdf3e48e42aa75ff530007cf03b96 (patch)
treefc28e2fb05ad0158fe881de7a49e90d941e10ad4 /test/integration/mastodon_websocket_test.exs
parent9f235028569968871ef9ea933459c6e9369e737a (diff)
parente19e82975871388831fd23adc50fcaaea85ad5da (diff)
downloadpleroma-9a9b60cfbcbcdf3e48e42aa75ff530007cf03b96.tar.gz
pleroma-9a9b60cfbcbcdf3e48e42aa75ff530007cf03b96.zip
Merge branch 'develop' into feature/allow-user-query-via-id
Diffstat (limited to 'test/integration/mastodon_websocket_test.exs')
-rw-r--r--test/integration/mastodon_websocket_test.exs7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/integration/mastodon_websocket_test.exs b/test/integration/mastodon_websocket_test.exs
index a604713d8..3975cdcd6 100644
--- a/test/integration/mastodon_websocket_test.exs
+++ b/test/integration/mastodon_websocket_test.exs
@@ -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