feat: allow custom URL scheme validation#409
feat: allow custom URL scheme validation#409yozachar merged 1 commit intopython-validators:masterfrom
Conversation
|
The only issue I see is that I could pass something as dumb as: url('httpx://crazy.example', validate_scheme=lambda x: True)This then resolves to: #396 (comment) |
I do not understand what is the issue mentioned above, and what part of the linked comment is relevant. Users want to have control over the accepted url schemes, because their problems define the schemes to work with which are not universal (e.g. only Now some potential users can not use the functionality in the library, because the scheme check is too strict for them. In the end, doing something dumb is the users responsibility - maybe what they end up with is a novel, but valid use :) |
|
@yozachar is there anything else I could do to get it merged and released? |
Enhances `validators.url` to allow
- restricting the allowed schemes (e.g. to accept only https,
and nothing else)
- relaxing the allowed schemes to also accept less known schemes
(e.g. ws, wss, ldap, ...)
9b8d48c to
6e7beeb
Compare
|
Apologies for the delay, thank you for the PR. |
Enhances
validators.urlto allowThis backward compatible change let's library users resolve the problematic cases requested/discussed in