Split REFLEX_CORS_ALLOWED_ORIGINS by comma#6067
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
|
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
|
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". |
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