Skip to content
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

Add the status code for the canonical endpoint, if live. #231

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

konklone
Copy link
Collaborator

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

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced
    in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

βœ… Pre-merge checklist

  • Revert dependencies to default branches.
  • Finalize version.

βœ… Post-merge checklist

  • Add a tag or create a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant