Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
HTTP::Cookie uses uri which parses URLs strictly according to RFC 3986.
Many HTTP clients allow requesting URLs which are not compliant with RFC 3986. In practice, this usually works. E.g. cURL supports a wider range of URLs described as “RFC 3986 plus”. Apart from 8-bit characters, the requested URL is more or less passed on verbatim to the server, even if it contains characters not permitted by RFC 3986. The same applies to web browsers.
Trying to “fix” non-compliant URLs is tricky. See e.g. httprb/http#758.
In the spirit of Postel's law (“be conservative in what you do, be liberal in what you accept from others”), I suggest HTTP::Cookie accepts a wider range of URLs.
With this PR, HTTP::Cookie does not parse URLs from strings if they are represented by an
URI
-like object, e.g.HTTP::URI
from http.rb orAddressable::URI
. This also reduces the work connected with converting aURI
-like object to a string and parsing it back into anotherURI
object.Fixes #24.