projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b39d6f
)
Add `Sec-WebSocket-Protocol` to response header
author
kPherox
<admin@mail.kr-kp.com>
Tue, 15 Oct 2019 10:10:22 +0000
(19:10 +0900)
committer
kPherox
<admin@mail.kr-kp.com>
Tue, 15 Oct 2019 12:09:44 +0000
(21:09 +0900)
lib/pleroma/web/mastodon_api/websocket_handler.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/mastodon_api/websocket_handler.ex
b/lib/pleroma/web/mastodon_api/websocket_handler.ex
index 3c26eb4069b2a2fb7bad3986d680ee0ffe21fd01..1a757363fc92bb17e8657feaa71665e6161a6468 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/websocket_handler.ex
+++ b/
lib/pleroma/web/mastodon_api/websocket_handler.ex
@@
-35,6
+35,13
@@
defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
{_, stream} <- List.keyfind(params, "stream", 0),
{:ok, user} <- allow_request(stream, [access_token, sec_websocket]),
topic when is_binary(topic) <- expand_topic(stream, params) do
+ req =
+ if sec_websocket != nil do
+ :cowboy_req.set_resp_header("sec-websocket-protocol", sec_websocket, req)
+ else
+ req
+ end
+
{:cowboy_websocket, req, %{user: user, topic: topic}, %{idle_timeout: @timeout}}
else
{:error, code} ->