fix: prevent web-test errors and validate domain inputs - #50
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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 does it do?
Web-test submissions could return HTTP 500 when the tested site supplied a valueless CSP directive, returned an HTTP/network error during cookie checks, or supplied malformed HSTS max-age data. These cases now produce assessment results. CSP parsing also preserves the first directive regardless of case and accepts flag directives and trailing semicolons.
The web-test form now accepts hyphenated domains, complete www hostnames, internationalized names, surrounding whitespace and HTTP(S) URLs. It normalizes these to the hostname whose homepage is assessed. Missing/incomplete names, malformed labels, unsupported schemes, credentials and ports return an escaped validation message with HTTP 400 before any network request or report write.
Validation: reproduced the failures before implementation; all 15 Django tests now pass, including full-view tests with isolated HTTP responses and a temporary test database. Added regressions for DNS errors, HTTP 403, malformed CSP/HSTS, normalized report names and invalid-input handling. Updated the Django CI matrix to Python 3.12/3.13, matching the existing Django 6 dependency requirements.
Django CI passes on Python 3.12 and 3.13. The separate Python application lint job still reports 14 pre-existing undefined-name findings in untouched IoT, cipher and IPv6 modules; the changed runtime files introduce no new core lint errors.
Release Type