diff options
author | Roman Chvanikov <chvanikoff@pm.me> | 2019-07-09 21:21:09 +0300 |
---|---|---|
committer | Roman Chvanikov <chvanikoff@pm.me> | 2019-07-09 21:21:09 +0300 |
commit | 371d39e160efa51f2fe608e1788f6b11b89d9839 (patch) | |
tree | b5dc6280d713f11392fd47bffd1a675b527162f5 /test/integration | |
parent | d2cb18b2a342b990cc47dfdc42adb843c3db1b5e (diff) | |
parent | 670a77ecbc94d57c6ecb5e569597e81cee4b5532 (diff) | |
download | pleroma-371d39e160efa51f2fe608e1788f6b11b89d9839.tar.gz pleroma-371d39e160efa51f2fe608e1788f6b11b89d9839.zip |
Merge develop
Diffstat (limited to 'test/integration')
-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 |