diff options
author | Ivan Tashkinov <ivant.business@gmail.com> | 2019-07-09 21:46:16 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivant.business@gmail.com> | 2019-07-09 21:46:16 +0300 |
commit | 829e99722396c2372770f50d9fc7cfa40c441005 (patch) | |
tree | 6b72aa4ac5e049eb8bf444ade64e8da4499ef023 /test/integration/mastodon_websocket_test.exs | |
parent | 46cf81a544edd91f4c3893897fbe2db053f5f6d5 (diff) | |
parent | 2bb945cb70751bc8e72c036040130bb54c32f391 (diff) | |
download | pleroma-829e99722396c2372770f50d9fc7cfa40c441005.tar.gz pleroma-829e99722396c2372770f50d9fc7cfa40c441005.zip |
[#878] Merge remote-tracking branch 'remotes/upstream/develop' into 878-activity-object-decoupling-in-tests
# Conflicts:
# lib/pleroma/object.ex
# test/web/activity_pub/transmogrifier_test.exs
# test/web/ostatus/ostatus_test.exs
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 |