-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add validator response fields for ipv6, ipv4 and http status code #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
s3lph
wants to merge
2
commits into
master
Choose a base branch
from
feat-dualstack-statuscode
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional that the checks below happen after setting the
Originheader, but ther egularReachable-Check above happens before?Also, couldn't the
validationResponse.Reachablevalue just bevalidationResponse.ReachableIPv6 || validationResponse.ReachableIPv4?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing that happens in L230-234 is the preparation of the request, not the actual sending. The single request will then be used 3 times below. As far as I understand it, setting
.Reachable = falsein L232 is actually a no-op, as the variable is initialized asfalseanyway. The actual "regular" check happens in L256 and onward.Unfortunately not.
validationResponse.Reachableis actually a bit of a misnomer, as it also checks for e.g. the HTTP status code (L274). With the IPv6 and IPv4 request, reachable just means "we got a HTTP response". I'm unsure whether this is the best approach, but it's one that doesn't break the semantics of existing API fields. You can look into SpaceApi/validator-web#14 to see how I'm using the new API fields in combination with existing ones without breaking the existing ones.If we decided to change the semantics of
validationResponse.Reachableinstead, I see it as a breaking change warranting a new major API version.