Remove invalid test
It is not allowed to use the Sec-WebSocket-Protocol header for arbitrary values. This was possible due to the raw websocket handling we were doing with Cowboy, but Phoenix.Socket.Transport does not allow this as the value of this header is compared against a static list of subprotocols. https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#socket/3-websocket-configuration Additionally I cannot find anywhere that we depended on this behavior. Setting the Sec-WebSocket-Protocol header does not appear to be a part of PleromaFE.
This commit is contained in:
parent
64ad451a7b
commit
d0f4b2b02f
@ -268,17 +268,6 @@ defmodule Pleroma.Integration.MastodonWebsocketTest do
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
test "accepts valid token on Sec-WebSocket-Protocol header", %{token: token} do
|
|
||||||
assert {:ok, _} = start_socket("?stream=user", [{"Sec-WebSocket-Protocol", token.token}])
|
|
||||||
|
|
||||||
capture_log(fn ->
|
|
||||||
assert {:error, %WebSockex.RequestError{code: 401}} =
|
|
||||||
start_socket("?stream=user", [{"Sec-WebSocket-Protocol", "I am a friend"}])
|
|
||||||
|
|
||||||
Process.sleep(30)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
test "accepts valid token on client-sent event", %{token: token} do
|
test "accepts valid token on client-sent event", %{token: token} do
|
||||||
assert {:ok, pid} = start_socket()
|
assert {:ok, pid} = start_socket()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user