Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add x-xsrftoken to Access-Control-Allow-Headers#2876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
rgbkrk merged 1 commit intojupyter:masterfromSamLau95:master
Sep 30, 2017

Conversation

@SamLau95
Copy link
Contributor

When starting a kernel using the Jupyter Notebook Kernel API, web
browsers will automatically check for the presence ofx-xsrftoken in
the Access-Control-Allow-Headers during the preflight CORS check
(ref).

Since we didn't allow this header before, web browsers would fail the
preflight check even when the x-xsrftoken header isn't being used by the
notebook server.

This meant that running a webpage on localhost:8080 that used Javascript
to start a kernel on a notebook server running on localhost:8888 would
fail.

How I tested this commit:

  1. Start a notebook server using

     jupyter notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''
  2. Build theweb3 example from ipywidgets.

  3. In that directory, runnpm run host.

  4. Verify that visitinghttp://localhost:8080/ starts a kernel in the notebook server.

When starting a kernel using the Jupyter Notebook Kernel API, webbrowsers will automatically check for the presence of `x-xsrftoken` inthe Access-Control-Allow-Headers during the preflight CORS check([ref][ref]).[ref]:https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-HeadersSince we didn't allow this header before, web browsers would fail thepreflight check even when the x-xsrftoken header isn't being used by thenotebook server.This meant that running a webpage on localhost:8080 that used Javascriptto start a kernel on a notebook server running on localhost:8888 wouldfail.How I tested this commit:1. Start a notebook server usingjupyter notebook --no-browser --NotebookApp.allow_origin="*" --NotebookApp.disable_check_xsrf=True --NotebookApp.token=''2. Build the [web3](https://github.com/jupyter-widgets/ipywidgets/tree/master/examples/web3) example from ipywidgets.3. In that directory, run `npm run host`.4. Verify that visiting http://localhost:8080/ starts a kernel in the notebook server.
@rgbkrk
Copy link
Member

This seems like the right choice for the default, thanks.

@yuvipanda
Copy link
Contributor

Do folks think we can make a point release with this?

@rgbkrk
Copy link
Member

We're waiting on#2203 according to@gnestor, then this should go out.

gnestor reacted with thumbs up emoji

@gnestor
Copy link
Contributor

@rgbkrk Care to review?#2911

@gnestorgnestor added this to the5.2 milestoneOct 13, 2017
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsApr 5, 2021
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@rgbkrkrgbkrkrgbkrk approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

4 participants

@SamLau95@rgbkrk@yuvipanda@gnestor

[8]ページ先頭

©2009-2025 Movatter.jp