Opened 4 years ago

Closed 8 months ago

#26424 closed New feature (wontfix)

Allow URLValidator to skip schemes validation

Reported by: Tim Graham Owned by: Baptiste Mispelon
Component: Core (Other) Version: master
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 Changed 4 years ago by Claude Paroz

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

comment:2 Changed 4 years ago by Burhan Khalid

Owner: changed from nobody to Burhan Khalid
Status: newassigned

comment:3 Changed 4 years ago by Tim Graham

Has patch: set
Patch needs improvement: set

PR with some comments for improvement.

comment:4 Changed 4 years ago by Burhan Khalid

Patch needs improvement: unset

comment:5 Changed 4 years ago by Tim Graham

Patch needs improvement: set

comment:6 Changed 4 years ago by Tim Graham

Patch needs improvement: unset

comment:7 Changed 4 years ago by Tim Graham

Patch needs improvement: set

comment:8 Changed 8 months ago by Baptiste Mispelon

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 Changed 8 months ago by Carlton Gibson

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 Changed 8 months ago by felixxm

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