Opened 10 years ago
Closed 6 years ago
#26424 closed New feature (wontfix)
Allow URLValidator to skip schemes validation
| Reported by: | Tim Graham | Owned by: | Baptiste Mispelon |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
As proposed by Claude in #26418, "provide some special value for scheme, like '__all__', to allow for all possible schemes (in the same spirit as the ModelForm fields / exclude attributes).
Change History (10)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:3 by , 10 years ago
| Has patch: | set |
|---|---|
| Patch needs improvement: | set |
PR with some comments for improvement.
comment:4 by , 10 years ago
| Patch needs improvement: | unset |
|---|
comment:5 by , 10 years ago
| Patch needs improvement: | set |
|---|
comment:6 by , 9 years ago
| Patch needs improvement: | unset |
|---|
comment:7 by , 9 years ago
| Patch needs improvement: | set |
|---|
comment:8 by , 6 years ago
| Owner: | changed from to |
|---|---|
| Patch needs improvement: | unset |
I took Burhan Khalid's pull request and updated it to target the 3.1 release.
I also tweaked the regexp for the accepted schemes to better match the RFC (I think).
As suggested by Tim in the previous pull request, I added a test to make sure all currently assigned schemes [1] are validated by the regexp.
[1] https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
comment:9 by , 6 years ago
As I commented on the PR, I'm not 100% convinced we shouldn't be saying that folks should create a custom validator for the known set of schemes that they want to accept, rather than adding an '__all__'. What do others think?
comment:10 by , 6 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | assigned → closed |
Agreed, I don't see a wide usage of __all__. In most of cases you want to add some schemas which is already possible. I believe solving #25594 would be a real solution for easy customizing the list of schemes.
It's not exactly about skipping scheme validation, but a minimal validation (e.g. all ascii letters and maximal length).