Skip to content

Commit

Permalink
Fix uri prefix detection
Browse files Browse the repository at this point in the history
foo,bar:baz is not a valid uri.

Refs: json-schema-org/JSON-Schema-Test-Suite#419
  • Loading branch information
ChALkeR committed Jul 22, 2020
1 parent 5389c5b commit b6ea484
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion formats.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports['time'] = /^\d{2}:\d{2}:\d{2}$/
exports['email'] = function (input) { return (input.indexOf('@') !== -1) && (!reEmailWhitespace.test(input)) }
exports['ip-address'] = exports['ipv4'] = createIpValidator({ version: 4 })
exports['ipv6'] = createIpValidator({ version: 6 })
exports['uri'] = /^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/
exports['uri'] = /^[a-zA-Z][a-zA-Z0-9+\-.]*:[^\s]*$/
exports['color'] = /(#?([0-9A-Fa-f]{3,6})\b)|(aqua)|(black)|(blue)|(fuchsia)|(gray)|(green)|(lime)|(maroon)|(navy)|(olive)|(orange)|(purple)|(red)|(silver)|(teal)|(white)|(yellow)|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))/
exports['hostname'] = function (input) {
if (!(reHostnameFirstPass.test(input))) return false
Expand Down

0 comments on commit b6ea484

Please sign in to comment.