mastodon websocket: return errors using ok, not stop
authorWilliam Pitcock <nenolod@dereferenced.org>
Thu, 28 Feb 2019 16:23:55 +0000 (16:23 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Thu, 28 Feb 2019 16:23:55 +0000 (16:23 +0000)
lib/pleroma/web/mastodon_api/websocket_handler.ex

index bb7ecad698a29b3b13f1e786299200112a285e39..8efe2efd59f4b2863ac85702888f369b3d6d5e8f 100644 (file)
@@ -37,12 +37,12 @@ defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
       {:error, code} ->
         Logger.debug("#{__MODULE__} denied connection: #{inspect(code)} - #{inspect(req)}")
         {:ok, req} = :cowboy_req.reply(code, req)
-        {:stop, req}
+        {:ok, req, state}
 
       error ->
         Logger.debug("#{__MODULE__} denied connection: #{inspect(error)} - #{inspect(req)}")
         {:ok, req} = :cowboy_req.reply(400, req)
-        {:stop, req}
+        {:ok, req, state}
     end
   end