Repository navigation
Conversation
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.
Closes #809
Collect refuses to download a form with an invalid submission URL. Detect malformed addresses while generating the form so authors can correct them before deployment.
Why is this the best possible solution? Were any other approaches considered?
Validate the HTTP/HTTPS scheme and hostname syntax with the standard library, without network requests or new dependencies. Validation runs in Survey.validate() so spreadsheet and JSON inputs follow the same rule. Preserve local hosts, IP addresses, internationalized domains, ports, and omitted settings. Reject control characters before parsing because the original address is written into the form.
What are the regression risks?
Malformed addresses previously accepted by pyxform now produce a clear error. Regression cases cover invalid schemes, hosts, ports, IPv6 syntax and control characters, plus valid remote/local endpoints and existing omitted-setting behavior. This checks syntax, not server reachability or DNS resolution.
Validation: 43 settings tests passed. The full unittest suite ran 1,182 tests and finished OK (6 skipped, 6 expected failures). One earlier run hit two transient psutil.NoSuchProcess errors in existing memory benchmarks; an unchanged full-suite retry passed. Ruff 0.15.21 formatting/lint and diff checks passed. Independent adversarial review and additional URL boundary checks passed.
Does this change require updates to documentation?
No new setting or syntax is introduced; invalid submission URLs now receive an explicit validation error.
Before submitting this PR, please make sure you have: