FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: add extra schemes to url validation by humbertogontijo · Pull Request #396 · python-validators/validators · GitHub

Repository navigation

feat: add extra schemes to url validation - #396

Closed
humbertogontijo wants to merge 1 commit into
python-validators:masterfrom
humbertogontijo:master
Closed

humbertogontijo wants to merge 1 commit into
python-validators:masterfrom
humbertogontijo:master

Conversation

Copy link
Copy Markdown

This allows for a more flexible scheme validation

Copy link
Copy Markdown
Collaborator

Hi @humbertogontijo, thanks for the PR. Such URLs bAdScHeMa://github.com will be validated if extra_schemes = {'bAdScHeMa',}.

Say a library user provides a domain name, which now suppose is validated against itself, wouldn't that defeat the purpose of domain validation? I think so.

We do plan to support more schemas, see #388.


validators.url method already has a lot of parameters, wouldn't adding more, clutter it? WDYT?

humbertogontijo commented Aug 8, 2024 •
edited
Loading

Copy link
Copy Markdown
Author

The idea is to just add custom schemes. For my purpose it would be for Telegram https://core.telegram.org/api/links

I do agree that this is more a URI than URL stuff though. But it would workout while uri validation is not available

Copy link
Copy Markdown
Collaborator

Yes, it will work, but that is no reason for doing counter-intuitive validation. If a huge number of schemas need to be validated, something like TLD validation can be performed.

Also tg:// links need not follow the classical http URL syntax, which therefore will return ValidationError regardless of the scheme.

So is it worth it, what do you think?

Copy link
Copy Markdown
Author

Thats ok. Thank you

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL