jupyter / tmpnb

Creates temporary Jupyter Notebook servers using Docker containers. [DEPRECATED - See BinderHub project]
https://github.com/jupyterhub/binderhub
BSD 3-Clause "New" or "Revised" License
528 stars 123 forks source link

Respond to OPTIONS request #247

Closed rgbkrk closed 7 years ago

rgbkrk commented 8 years ago

We need to respond to OPTIONS requests with the CORS headers we care about. This was done in the main notebook.

Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:3000' is therefore not allowed access. The response had HTTP status code 405.
SylvainCorlay commented 7 years ago

:+1:

SylvainCorlay commented 7 years ago

Do we only need to set the default value of Access-Control-Allow-Methods to GET, PUT, POST, PATCH, DELETE, OPTIONS' ?

rgbkrk commented 7 years ago

I think so.

SylvainCorlay commented 7 years ago

@rgbkrk I got back into this. Adding the OPTIONS to allow-methods did not do the trick.

curl -X OPTIONS https://tmpnb.org/api/spawn
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1346, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 225, in options
    raise HTTPError(405)
HTTPError: HTTP 405: Method Not Allowed