Skip to content

Commit 652c095

Browse files
author
Guillaume Tournier
committed
url protocols option
1 parent ce3c8dc commit 652c095

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+98
-518
lines changed

.babelrc

100644100755
File mode changed.

.bootstraprc

100644100755
File mode changed.

.gitignore

100644100755
File mode changed.

.npmignore

100644100755
File mode changed.

.travis.yml

100644100755
File mode changed.

README.md

100644100755
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,15 @@ Validates that the specified value is a valid URL. It uses the internal `REG_URL
341341
validate={url()} />
342342
```
343343

344+
The url validator has an option `protocol` (or its alias `protocols`) that receives the set of protocols that will be accepted. This option default to ['http', 'https', 'ftp'].
345+
346+
Examples
347+
```
348+
url({ protocol: 'http' })
349+
url({ protocol: 'ftp' })
350+
url({ protocols: ['http', 'https'] })
351+
```
352+
344353
The default error message is "is not a valid URL".
345354

346355

0 commit comments

Comments
 (0)