fix: correct _allowed_origins typo to allowed_cors_origins in CORS middleware (closes #2083) - #2087
Conversation
…ddleware (closes riteshbonthalakoti#2083) Line 1600 defines allowed_cors_origins = get_allowed_origins() but line 1605 references _allowed_origins (underscore prefix), which was never defined. This causes a NameError at server startup, crashing the entire API. Fix: rename _allowed_origins to allowed_cors_origins on line 1605.
|
@namann5 is attempting to deploy a commit to the ritesh Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superb implementation, @namann5! I've successfully resolved all conflicts in your PR and queued it for merging into
Keep up the outstanding work! Let's build together! 🔥 |
e488dba
into
riteshbonthalakoti:gssoc
Description
Fixes a critical
NameErrorat server startup that crashes the entire API.The Bug
backend/main.py:1600definesallowed_cors_origins = get_allowed_origins()butbackend/main.py:1605references_allowed_origins(note the underscore prefix), which was never defined.When the server starts, FastAPI evaluates the CORS middleware configuration and throws:
This crashes the server before any endpoint can respond.
Fix
One character fix:
_allowed_origins→allowed_cors_originson line 1605.Closes #2083