From: Haelwenn (lanodan) Monnier Date: Sun, 7 Jul 2019 06:58:24 +0000 (+0200) Subject: mastodon_websocket_test.exs: Test for Sec-WebSocket-Protocol header X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=b5ba41a7255e23285810d865f0fef7701ab4ca6c;p=akkoma mastodon_websocket_test.exs: Test for Sec-WebSocket-Protocol header --- 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