diff options
author | Mark Felder <feld@FreeBSD.org> | 2019-07-09 12:49:04 -0500 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2019-07-09 12:49:04 -0500 |
commit | 9a9b60cfbcbcdf3e48e42aa75ff530007cf03b96 (patch) | |
tree | fc28e2fb05ad0158fe881de7a49e90d941e10ad4 /test/integration/mastodon_websocket_test.exs | |
parent | 9f235028569968871ef9ea933459c6e9369e737a (diff) | |
parent | e19e82975871388831fd23adc50fcaaea85ad5da (diff) | |
download | pleroma-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.exs | 7 |
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 |