[Validator] Do URL validation according to RFC's #12514
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is still very rough but I just want to throw it out there so people can comment etc.
This PR makes the URL validator RFC aware and more configurable (question should it be more configurable?).
The idea is that we take RFC3986 as a base for the validator and let people configure it according to there needs.
I was mainly thinking of not allowing ip addresses or using custom host name constraints based on different RFC's.
One of the main problems with the new implementation is that none of the RFC's (as far as i can see) allow UTF-8 characters in the host name and this gives some trouble with this current tests. (aka IDN domains).
P.S. the RFC3986 regex can be found at https://gist.github.com/boekkooi/d24fcee6f7082e802ce1/revisions (this is not a full regex since i didn't implement
hier-part
fully)