Skip to content

Commit

Permalink
Enable check_origin on gateway websocket communication (#5471)
Browse files Browse the repository at this point in the history
This is a port of the same change in NB2KG (PR 22).

Fixes #5460

Co-authored-by: Dylan <[email protected]>

Co-authored-by: Dylan <[email protected]>
  • Loading branch information
kevin-bates and dylanzjy authored May 25, 2020
1 parent 01e298f commit 66ad3f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions notebook/gateway/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class WebSocketChannelsHandler(WebSocketHandler, IPythonHandler):
kernel_id = None
ping_callback = None

def check_origin(self, origin=None):
return IPythonHandler.check_origin(self, origin)

def set_default_headers(self):
"""Undo the set_default_headers in IPythonHandler which doesn't make sense for websockets"""
pass
Expand Down

0 comments on commit 66ad3f4

Please sign in to comment.