I'm currently keeping these as longs. That's easy an unambiguous, but it also
feels rather primitive.
This was more work than I expected, but it doesn't seem particularly risky.
It's also potentially more efficient, since there's fewer places where we're
converting from string to long and vice versa.
Closes: https://github.com/square/okhttp/issues/2035
Still some work to do on method naming, but this was the interesting part.
Also very much need to rename OkUrlFactory in tests to urlFactory, otherwise
the client.client stuff becomes madness.
There's a big consequence to this for compatible with RFC 2965 Cookies. In particular,
this drops our ability to support 'Set-Cookie2' headers, and some features used there
including quoted attributes like 'Max-Age="25"'. This is the right move for interop with
browsers, and likely to make things better for application developers, but some
people who strictly followed the RFC 2965 spec will be broken. (That spec was never
seriously adopted anywhere, which is the entire motivation of RFC 6265.)
The upside is the CookieJar interface is now much more straightforward. This is
particularly good going forward, and for clients who don't have to worry about the
strangeness of things like $Version=1 in the RFC 2965 spec.
No good first-party implementation yet.
There is an implementation in okhttp-urlconnection that delegates to the java.net
CookieHandler. That should be good enough for AOSP.
This is awkward because it adds another field to the cache. I've
decided to try to keep old values in the cache working. We will
probably do a change that'll disrupt the cache later, but that
is invasive and we don't need that yet.
There's a mostly-academic corner case on URLs like http://host/%xx that
have a malformed escape sequence. This changes the exceptions on those
URLs from checked to unchecked.
I think we may want a separate change to HttpUrl to fix those URLs to
be encoded as http://host/%25xx which avoids the problem altogether.
Closes: https://github.com/square/okhttp/issues/2106
We aren't yet ready to make FileSystem a public type, but I don't mind
making it _almost_ available via an internal API for those brave enough
to try that.
Also migrate all of our tests to use the in memory file system. It's simpler.
https://github.com/square/okhttp/issues/1459