Skip to content

Commit 65f807c

Browse files
authored
Merge pull request jupyterhub#1906 from agoose77/agoose77/fix-cors-versions
2 parents 41a95ee + f398f88 commit 65f807c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

binderhub/base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ class VersionHandler(BaseHandler):
216216
# (e.g. mybinder.org federation when blocking cloud datacenters)
217217
skip_check_request_ip = True
218218

219+
def set_default_headers(self):
220+
if "Access-Control-Allow-Origin" not in self.settings.get("headers", {}):
221+
# allow CORS requests to this endpoint by default
222+
self.set_header("Access-Control-Allow-Origin", "*")
223+
224+
super().set_default_headers()
225+
219226
async def get(self):
220227
self.set_header("Content-type", "application/json")
221228
r = {

0 commit comments

Comments
 (0)