Opened 8 years ago

Closed 4 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 Claude Paroz, 8 years ago

It's not exactly about skipping scheme validation, but a minimal validation (e.g. all ascii letters and maximal length).

comment:2 by Burhan Khalid, 8 years ago

Owner: changed from nobody to Burhan Khalid
Status: newassigned

comment:3 by Tim Graham, 8 years ago

Has patch: set
Patch needs improvement: set

PR with some comments for improvement.

comment:4 by Burhan Khalid, 8 years ago

Patch needs improvement: unset

comment:5 by Tim Graham, 8 years ago

Patch needs improvement: set

comment:6 by Tim Graham, 8 years ago

Patch needs improvement: unset

comment:7 by Tim Graham, 8 years ago

Patch needs improvement: set

comment:8 by Baptiste Mispelon, 4 years ago

Owner: changed from Burhan Khalid to Baptiste Mispelon
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.

PR here

[1] https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml

comment:9 by Carlton Gibson, 4 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 Mariusz Felisiak, 4 years ago

Resolution: wontfix
Status: assignedclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top