Skip to content

Commit

Permalink
Fall back to using hub xsrf
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansick committed May 15, 2024
1 parent e879877 commit f021306
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/noteburst/jupyterclient/jupyterlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,13 @@ async def execute_notebook(
"""
exec_url = self.url_for(f"user/{self.user.username}/rubin/execution")
headers = {}
if self._lab_xsrf is None:
self.logger.warning("No XSRF token found for JupyterLab")
if self._lab_xsrf:
headers["X-XSRFToken"] = self._lab_xsrf
elif self._hub_xsrf:
self.logger.warning(
"No XSRF token found for JupyterLab, using hub token."
)
headers["X-XSRFToken"] = self._hub_xsrf
try:
# The timeout is designed to catch issues connecting to JupyterLab
# but to wait as long as possible for the notebook itself
Expand Down

0 comments on commit f021306

Please sign in to comment.