Websocket handler: fix never matching code on failed auth
authorrinpatch <rinpatch@sdf.org>
Thu, 10 Sep 2020 18:26:52 +0000 (21:26 +0300)
committerrinpatch <rinpatch@sdf.org>
Thu, 10 Sep 2020 18:26:52 +0000 (21:26 +0300)
`:cowboy_req.reply` does not return tuples since 2.0, see
https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.reply/

lib/pleroma/web/mastodon_api/websocket_handler.ex

index 5090d96221c271a055585b61d1ce8ff76e5ab878..cf923ded84d8e853fae65219aaa9e7aec7aaa0a2 100644 (file)
@@ -37,12 +37,12 @@ defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
     else
       {:error, :bad_topic} ->
         Logger.debug("#{__MODULE__} bad topic #{inspect(req)}")
-        {:ok, req} = :cowboy_req.reply(404, req)
+        req = :cowboy_req.reply(404, req)
         {:ok, req, state}
 
       {:error, :unauthorized} ->
         Logger.debug("#{__MODULE__} authentication error: #{inspect(req)}")
-        {:ok, req} = :cowboy_req.reply(401, req)
+        req = :cowboy_req.reply(401, req)
         {:ok, req, state}
     end
   end