Allow CORS from https://www.xmoj.tech#59
Merged
PythonSmall-Q merged 2 commits intomasterfrom Mar 19, 2026
Merged
Conversation
Co-authored-by: PythonSmall-Q <106425289+PythonSmall-Q@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add CORS support for https://www.xmoj.tech
Allow CORS from https://www.xmoj.tech
Mar 19, 2026
PythonSmall-Q
approved these changes
Mar 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Cloudflare Worker entrypoint CORS allowlist to permit browser requests from https://www.xmoj.tech, enabling the xmoj.tech frontend to call the API cross-origin.
Changes:
- Add
https://www.xmoj.techas an explicitly allowed origin ingetAllowedOrigin. - CORS behavior remains deny-by-default for all other origins.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot stopped work on behalf of
PythonSmall-Q due to an error
March 19, 2026 12:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The XMOJ main site (
https://www.xmoj.tech) was not in the allowed CORS origins list, causing cross-origin requests from it to be rejected.Changes
Source/index.ts: Addedhttps://www.xmoj.techas an exact-match allowed origin ingetAllowedOrigin, covering both preflightOPTIONSresponses and regular response headers.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
registry.npmmirror.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/_temp/ghcca-node/node/bin/npm install(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/_temp/ghcca-node/node/bin/npm install --ignore-scripts(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.
Summary by cubic
Allow cross-origin requests from https://www.xmoj.tech to our API. This lets the xmoj.tech frontend call our endpoints from the browser.
getAllowedOrigin.Written for commit 8d5c15b. Summary will update on new commits.