Add CORS support for app.merabytes.com and local.merabytes.com#2
Merged
Add CORS support for app.merabytes.com and local.merabytes.com#2
Conversation
- Add support for app.merabytes.com and local.merabytes.com - Implement dynamic origin validation and matching - Extract Origin header from request and validate against allowed list - Return matching origin in CORS response header - Support comma-separated CORS_ORIGIN env variable for custom origins - Update documentation with multi-origin CORS configuration examples Co-authored-by: kn0wm4d <15344287+kn0wm4d@users.noreply.github.com>
- Filter out empty strings when parsing CORS_ORIGIN env variable - Add fallback to default origins if parsed list is empty - Implement case-insensitive Origin header lookup - Add clarifying comment about Lambda execution context safety - Add comprehensive edge case testing Co-authored-by: kn0wm4d <15344287+kn0wm4d@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add CORS support for app and local subdomains
Add CORS support for app.merabytes.com and local.merabytes.com
Dec 20, 2025
Contributor
|
@copilot It has to support the three origins by default |
Copilot stopped work on behalf of
kn0wm4d due to an error
December 20, 2025 20:15
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 Lambda function needs to accept requests from multiple frontend domains:
app.merabytes.comandlocal.merabytes.comin addition to the existingsecrets.merabytes.com.Changes
Dynamic origin validation
Originheader from requests (case-insensitive)Access-Control-Allow-Originresponse headerConfiguration
secrets.merabytes.com,app.merabytes.com,local.merabytes.comCORS_ORIGINenv var:https://app1.com,https://app2.comImplementation
Backward compatible: existing single-origin configurations continue to work.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.