- #1220 (minor)
Theurltype now warns on values that only parse becausenew URL()is permissive: anything not written asscheme://...(like an SSH key fingerprintSHA256:...oruser:pass), whitespace or control characters, a missing host, and malformedhttp/httpshosts the parser would otherwise rewrite (https:///example.com,http://0x7f.1,https://a..b). It also warns on protocols other thanhttp/httpswhenallowedProtocolsis not set. These become errors in the next major version. New options:allowedProtocols="*"allows any protocol, andallowNoHost=trueallows host-less URLs likesqlite:///app.db. - #1218 (patch)
url(allowedDomains=...)now rejects values whose host other URL parsers could read differently (backslashes, whitespace, percent-encoded or non-ASCII hosts, IPv4 shorthand, missingscheme://host), which could let a value pass the allowlist while the app connects elsewhere. Write internationalized hosts in punycode.url(prependHttps=true)now prefixeshost:portvalues likelocalhost:3000.
Published to
- ✅ custom