Split REFLEX_CORS_ALLOWED_ORIGINS by comma#6067
Merged
Conversation
Default delimiter is colon with no stripping of whitespace. However for CORS it's much more convenient to split on a comma. Extend the env_var interpretation system to pull a new SequenceOptions object out of an Annotated type hint. Fix #6066
CodSpeed Performance ReportMerging #6067 will not alter performanceComparing Summary
|
Contributor
Greptile SummaryChanged
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Config
participant interpret_env_var_value
participant SequenceOptions
User->>Config: Set REFLEX_CORS_ALLOWED_ORIGINS="http://a.com,http://b.com"
Config->>interpret_env_var_value: Parse cors_allowed_origins field
interpret_env_var_value->>interpret_env_var_value: Strip entire value
interpret_env_var_value->>interpret_env_var_value: Check if Annotated type
interpret_env_var_value->>SequenceOptions: Extract delimiter="," from annotations
interpret_env_var_value->>interpret_env_var_value: Split by delimiter ","
interpret_env_var_value->>interpret_env_var_value: Apply strip if enabled
loop For each item
interpret_env_var_value->>interpret_env_var_value: Recursively interpret as str
interpret_env_var_value->>interpret_env_var_value: Strip individual item
end
interpret_env_var_value->>Config: Return ["http://a.com", "http://b.com"]
Config->>User: CORS origins configured
|
Contributor
Greptile's behavior is changing!From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
adhami3310
approved these changes
Dec 23, 2025
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.
Default delimiter is colon with no stripping of whitespace. However for CORS it's much more convenient to split on a comma.
Extend the env_var interpretation system to pull a new SequenceOptions object out of an Annotated type hint.
Fix #6066