Skip to content

Commit

Permalink
set xsrf cookie on base url
Browse files Browse the repository at this point in the history
avoids collisions across a given host
  • Loading branch information
minrk committed Nov 18, 2021
1 parent 6c8c923 commit 9619019
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ def init_settings(

# allow custom overrides for the tornado web app.
settings.update(settings_overrides)

if base_url and "xsrf_cookie_kwargs" not in settings:
# default: set xsrf cookie on base_url
settings["xsrf_cookie_kwargs"] = {"path": base_url}
return settings

def init_handlers(self, default_services, settings):
Expand Down

0 comments on commit 9619019

Please sign in to comment.