Skip to content

Commit

Permalink
Merge pull request #1906 from agoose77/agoose77/fix-cors-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk authored Jan 15, 2025
2 parents 41a95ee + f398f88 commit 65f807c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions binderhub/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ class VersionHandler(BaseHandler):
# (e.g. mybinder.org federation when blocking cloud datacenters)
skip_check_request_ip = True

def set_default_headers(self):
if "Access-Control-Allow-Origin" not in self.settings.get("headers", {}):
# allow CORS requests to this endpoint by default
self.set_header("Access-Control-Allow-Origin", "*")

super().set_default_headers()

async def get(self):
self.set_header("Content-type", "application/json")
r = {
Expand Down

0 comments on commit 65f807c

Please sign in to comment.