jupyter / jupyter/notebook

HTTP Headers not sent when user not logged in and in /tree?

Open
#4,747 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

Hi,
I am trying to set HTTP headers like `Content-Security-Policy, X-Content-Type-Options, Cache-Control ` by setting values in jupyter_notebook_config.py as
```
c.NotebookApp.tornado_settings = {
'headers': {
X-Content-Type-Options': 'nosniff'
}
}
```

However, when notebook is opened in Firefox or IE, it by default goes to /tree? (when user logged in) and /login (if user not logged in). In both of these cases headers are not present. Headers are present only when user is logged in and no /tree? etc path is appended in URL.

Contributor guide

Open the contributing guide

Research direction

Start with jupyter_notebook_config.py and the tornado_settings headers configuration, then reproduce requests to /login and /tree in both authenticated and unauthenticated states. Compare their response headers with the direct notebook URL; done means the configured headers are present on all relevant responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook
Domain
backend, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.