Feature/cors origin validation#388
Open
d3v-active wants to merge 3 commits into
Open
Conversation
…e for read‑heavy queries
…igrations for SQLite dev
Contributor
|
@d3v-active resolve conflicts please |
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.
Closes #211
This change adds a safety check that prevents the application from starting in production when the
CORS_ORIGINSenvironment variable is not set.What was added
bootstrapfromsrc/main.tsso it can be invoked directly in tests.bootstrap:NODE_ENVand, if it is'production', verifies thatCORS_ORIGINSis defined.CORS_ORIGINS must be set in productionif the variable is missing, causing the process to abort early.test/security.e2e-spec.ts):bootstrap.Bootstrap validationthat checks the bootstrap aborts with the expected error whenCORS_ORIGINSis unset in production.Why this matters
CORS_ORIGINSin production resulted in the server silently booting with an empty CORS whitelist. Every cross‑origin request then failed with a generic “Not allowed by CORS” message, making troubleshooting difficult and potentially causing downtime during critical humanitarian deployments.Verification
bootstrap()rejects with an error containingCORS_ORIGINSwhen the variable is missing in production mode.