I'm not sure if this is desired behavior or not, but when I pass a url
with double quotes in it to URI.parse, it rasies URI::InvalidURIError
(bad URI(is not URI?). It appears that (at least some) browsers load a
website that has double quotes in the url.
Is this error raised for a particular reason (e.g. specification of url
excludes use of double quotes)? Or is it safe for me to ignore this
error?
On Thu, Dec 19, 2013 at 5:22 PM, David Ragone <lists@ruby-forum.com> wrote:
I'm not sure if this is desired behavior or not, but when I pass a url
with double quotes in it to URI.parse, it rasies URI::InvalidURIError
(bad URI(is not URI?).
Is this error raised for a particular reason (e.g. specification of url
excludes use of double quotes)?
Definitely understandable. I've looked at 1738, and see that (at that
time, at least), double quotation marks were considered unsafe. I'll
take a look at 3986.
Others have shown the RFCs for URLs. What isn't altogether clear is that
browsers quite often present URLs different than they process them
internally (more human-readable sort of thing, etc). While it may look as
though your browser is handling a double quote, it is very likely not the
case when it makes the request and receives the response.
The URI module is quite precise, and is not attempting to do anything in a
human-readable fashion, but handle URIs in the way the network protocols
need them.
···
On Thu, Dec 19, 2013 at 7:22 PM, David Ragone <lists@ruby-forum.com> wrote:
I'm not sure if this is desired behavior or not, but when I pass a url
with double quotes in it to URI.parse, it rasies URI::InvalidURIError
(bad URI(is not URI?). It appears that (at least some) browsers load a
website that has double quotes in the url.
Is this error raised for a particular reason (e.g. specification of url
excludes use of double quotes)? Or is it safe for me to ignore this
error?