Skip to content

Commit

Permalink
fix: allow Access-Control-Allow-Origin=* on versions API
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Jan 9, 2025
1 parent 3b3743b commit 6d4cf4f
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():
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 6d4cf4f

Please sign in to comment.