fix: Optimize IP detection logic and add error handling#4039
Merged
Conversation
|
@God-2077 is attempting to deploy a commit to the umami-software Team on Vercel. A member of the Team first needs to authorize it. |
- umami-software#4038 - Check existence of clientIp and ignoreIps in advance - Add error handling for CIDR parsing
383201e to
9a66a2a
Compare
Contributor
Greptile SummaryThis PR fixes a crash in the
Confidence Score: 4/5
Important Files Changed
Flowchartflowchart TD
A["hasBlockedIp(clientIp)"] --> B{clientIp and ignoreIps exist?}
B -- No --> C[return false]
B -- Yes --> D["Split ignoreIps by comma"]
D --> E["For each ip in list"]
E --> F{Exact match?}
F -- Yes --> G[return true]
F -- No --> H{CIDR notation?}
H -- No --> I[return false]
H -- Yes --> J["try: parse clientIp & CIDR range"]
J --> K{Same kind & match?}
K -- Yes --> G
K -- No --> I
J -- "catch: parse error" --> I
Last reviewed commit: 9a66a2a |
vdmsmnk
added a commit
to vdmsmnk/umami
that referenced
this pull request
Mar 18, 2026
mikecao
approved these changes
May 14, 2026
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.
Uh oh!
There was an error while loading. Please reload this page.