I have URI that contains ##
(e.g. http://foo.com/bar##baz
) . Ruby's URI.parse
function throws an error when I try to parse it.
Are double hash marks forbidden in URIs? Or is the Ruby Parser too strict?
Fragment Identifiers may not contain a hash sign. The parser is correct.
The syntax for a fragment identifier is defined as follows:
fragment = *( pchar / "/" / "?" )
pchar
is defined as:
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved
, pct-encoded
and sub-delims
are defined as:
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
pct-encoded = "%" HEXDIG HEXDIG
sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With