Add the status code for the canonical endpoint, if live. #231
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.
Adds a top-level
Status
field for the canonical status code🗣 Description
Takes the HTTP status code of the canonical endpoint and puts it as a top-level field of the response.
💭 Motivation and context
This allows an easy analysis of what status code a website (or API) at the given domain lands on once it's through redirects.
This data is present on each of the 4 analyzed endpoints, but if a client wanted to parse through the response to get this answer, it would be messy and need to analyze the canonical URL and determine which endpoint to dive into. This is cleaner and answers a common question.
🧪 Testing
The test suite is very incomplete and doesn't really exercise meaningful code paths. So, I didn't add a test for this. If one is desired, I'm willing to add one, but it seems like it would be worth doing for more than this.
I am currently testing this through some large scans of the USG space.
✅ Pre-approval checklist
in code comments.
to reflect the changes in this PR.
✅ Pre-merge checklist
✅ Post-merge checklist