Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
URL type input does not support file:/// protocol. #11341
Very easy to reproduce. Any form input of type 'url' will return undefined for a file:/// protocol entry.
To reproduce go to the following Plunker and enter 'file://some/file' to the input. The HTML5 validation succeeds, but the file protocol is not supported.
referenced this issue
Mar 20, 2015
The problem here is that ng/directive/input.js has the following regular expression
This is insufficient.
For input[type=url], the html5 spec says:
A scheme's is defined as:
Angular only accepts ftp, http, and https.
Since I doubt anybody is interested in going down the rabbit hole of writing a regular expression to try to match the full grammar, I propose the following small changes to the existing REGEX:
The two changes are 1) allow more permissive schemes and 2) make the two slashes optional as defined by the RFC.
You can see my changes and a bunch of extra unit tests in #11381.
(To help with understanding the regex see https://regex101.com/)
Finally found a issue related to the customized protocol. All issues about url validation says nothing about this.