You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked the relevant RFCs but maybe I missed if this was legitimate or not. I would expect URLs which contain angle brackets <> to cause a parse error.
In RFC1738, angle brackets are treated as unsafe and "must always be encoded within a URL" (section 2.2)
In RFC2396, URIs exclude angle brackets specifically (section 2.4.3)
In RFC3986, the allowed character set for the various URI components doesn't include angle brackets (sections 2 and 3), and in Appendix C, it is recommended that "using <> angle brackets around each URI is especially recommended as a delimiting style for a reference that contains embedded whitespace.", which suggests to me that angle brackets are explicitly excluded from the URI character set
This library implements the WHATWG URL Standard, not any IETF RFC. That said, it’s quite possible that the spec has changed and this implementation hasn’t caught up yet: #163, #290.
Also note that the normative requirement for a tool (or human) that produces an URL string may be different from those for a different tool that parses such a string.
This library implements the WHATWG URL Standard, not any IETF RFC. That said, it’s quite possible that the spec has changed and this implementation hasn’t caught up yet: #163, #290.
Also note that the normative requirement for a tool (or human) that produces an URL string may be different from those for a different tool that parses such a string.
That makes sense, thanks. whatwg-url validates http://www.exam<ple.com/ successfully too.
I checked the relevant RFCs but maybe I missed if this was legitimate or not. I would expect URLs which contain angle brackets
<>
to cause a parse error.Short example code:
output:
success: http://www.exam<ple.com/
For what it's worth, in Firefox,
new URL("http://exam<ple.com/")
returnsTypeError: http://exam<ple.com/ is not a valid URL.
The text was updated successfully, but these errors were encountered: