-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Allow square braces in URL validation #1487
Allow square braces in URL validation #1487
Conversation
Can you please add a test or two? Just to show the previous failing URI and that it is now passing. :) |
Done @WesTyler |
I don't think you can do it this way. Brackets need to go last and by pair, this PR is allowing any number of brackets anywhere, this looks invalid to me. |
I'll correct the PR to ensure the brackets come in pairs but isn't the point of the PR to also allow any number of paired brackets. For example: |
The point is to validate an URL is valid. Those brackets are clearly invalid regarding RFC3986, but since then we have the whatwg one (https://url.spec.whatwg.org/#query-state), and I'm not sure for example |
From what I can see of the RFC's it is clearly invalid state given by the URL producer, but it also says it should still be transformed and understood. As there is nothing about this particular case (as it's invalid), I feel like the best course of action would be to stay as strict as possible and later on become more lenient as/if required. That's of course an opinion as this isn't something really by the specs (for obvious reasons). Really appreciate that someone picked this up before I had a chance, thanks for the work being done to write and review it! |
I'm going to allow it as an option defaulting to false. This kind of URI is very common nowadays, but I still want to adhere to RFC3986 by default. |
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
What does this PR do
Allow square braces in URL validation
Description of Task to be completed
Update regex to accept square braces
How should this be manually tested
the snippet above wouldn't result in error because it's a valid URL with query.
Any background context you want to add
Fixes Issue: 1461
Screenshots