Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isURL should have an option to not validate by length #1396

Closed
tomgrossman opened this issue Jul 29, 2020 · 2 comments
Closed

isURL should have an option to not validate by length #1396

tomgrossman opened this issue Jul 29, 2020 · 2 comments
Labels

Comments

@tomgrossman
Copy link
Contributor

tomgrossman commented Jul 29, 2020

Describe the bug
The isURL function has a hardcoded validation:

if (!url || url.length >= 2083 || /[\s<>]/.test(url)) {
    return false;
}

The URL length should be an option to overwrite the length or to skip this validation.

Additional context
validator version: 13.1.1
2083 is the maximum URL length for IE, but not for the rest of the browsers and it isn't part of the RFC:
https://support.microsoft.com/en-us/help/208427/maximum-url-length-is-2-083-characters-in-internet-explorer
https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers
https://chromium.googlesource.com/chromium/src/+/master/docs/security/url_display_guidelines/url_display_guidelines.md#:~:text=URL%20Length,-In%20general%2C%20the&text=Chrome%20limits%20URLs%20to%20a,is%20used%20on%20VR%20platforms.

@profnandaa
Copy link
Member

PR welcome.

@tomgrossman
Copy link
Contributor Author

@profnandaa done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants