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

Accept file:// URLs per RFC 8089 by itzzdev09 · Pull Request #483 · python-validators/validators · GitHub

Repository navigation

Accept file:// URLs per RFC 8089 - #483

Open
itzzdev09 wants to merge 1 commit into
python-validators:masterfrom
itzzdev09:fix/url-file-scheme
Open

itzzdev09 wants to merge 1 commit into
python-validators:masterfrom
itzzdev09:fix/url-file-scheme

Conversation

itzzdev09 commented Sep 26, 2026 •
edited
Loading

Copy link
Copy Markdown

Fixes #481.

url() rejected file:// URLs such as file:///var/www because their authority (netloc) is empty or "localhost", neither of which _validate_netloc accepts as a hostname. RFC 8089 defines both an empty and a "localhost" authority as valid for a local file URL, so this adds file to the accepted schemes and skips hostname validation for those two authorities specifically.

A file:// URL with a non-local authority (file://example.com/path) still goes through the normal hostname check, unchanged.

url() rejected file:// URLs like file:///var/www because their
authority (netloc) is empty or "localhost", neither of which
_validate_netloc accepts as a hostname. RFC 8089 defines both an
empty and a "localhost" authority as valid for a local file URL.

A file URL with a non-local authority (file://example.com/path)
still goes through the normal hostname check, unchanged.

This branch has not been deployed

No deployments
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.

Local file URL validation

1 participant


Back | FazBrowse Home | New Git URL