Add HTTP Status Code column to CSV output - #729
Open
ocervell wants to merge 1 commit into
Open
Conversation
security_headers.collect_http_headers already performs the request but discarded the response status on success. Capture it (and the error code on HTTPError) into the collected headers as "Response Code", and add a "Status Code" column to Requests.csv so the real HTTP code is available in machine-readable output — not just "Successful" / an error state. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Adds the HTTP response status code to EyeWitness's machine-readable output.
security_headers.collect_http_headersalready makes the request but discardedresponse.statuson success. It now captures it (ande.codeonHTTPError) into the collected headers asResponse Code.reporting.pygains aStatus Codecolumn inRequests.csv(afterRequest Status), populated from that value.Why
Requests.csvonly exposedRequest Status— the browser outcome (Successful/Timeout/BadStatus/ …), not the actual HTTP code. Tools that consume the CSV had no way to distinguish a200from a301/404/500that still rendered. This surfaces the real code (relates to #141, whose "Response Code in headers" behavior had since been refactored out).Behavior
Successfulresponses now record the real code (e.g.200,301).HTTPErrorresponses record the error code (e.g.404,500).Response Code), so it shows in the HTML report too.Testing
Ran
--webagainst a local nginx target: