You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current IPv4 validation accepting non-IPv4 addresses such as 000000.010101.256.101, 192.168.0.300, 256.0.0.0 and bunch of other cases I mentioned in regex101 link. Newly defined pattern will take care all of such cases.
You can play with newly defined regex pattern here: https://regex101.com/r/j4lkR3/1
Has your change been tested?
Changes has been tested on regex playground
Types of changes
What sort of change does your code introduce/modify?
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
My code follows the code style of this project.
My change requires a change to the documentation.
I have updated the documentation accordingly.
I have added tests to cover my changes.
All new and existing tests passed.
This change is using publicly documented in cloudflare/api-schemas
and relies on stable APIs.
let me have a think about this one as the regex is intentionally broad to catch anything that looks like it may be an IP, not just valid ones. this ensures that even if someone provides an invalid IP, it recommends the documented ranges we expect here.
to be clear here, I'm not against refining the regex. I just want to have a look over the previous tests cases that this helped and make sure we would have still caught them.
Oh, I had the impression that the current broader-matching regex was acceptable. My apologies for the misinterpretation. Kindly inform me once you've had the opportunity to look into previous test cases. Reopening🚀
Merging #1382 (4e081a3) into master (b9ac804) will increase coverage by 0.33%.
Report is 303 commits behind head on master.
The diff coverage is 49.62%.
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 freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
3 participants
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.
Description
Current IPv4 validation accepting non-IPv4 addresses such as 000000.010101.256.101, 192.168.0.300, 256.0.0.0 and bunch of other cases I mentioned in regex101 link. Newly defined pattern will take care all of such cases.
You can play with newly defined regex pattern here: https://regex101.com/r/j4lkR3/1
Has your change been tested?
Changes has been tested on regex playground
Types of changes
What sort of change does your code introduce/modify?
Checklist:
and relies on stable APIs.