1
0
mirror of https://github.com/square/okhttp.git synced 2025-12-25 00:01:02 +03:00
Commit Graph

15 Commits

Author SHA1 Message Date
Jesse Wilson
112f020c41 Change the cache to have non-shared semantics.
This means we'll cache responses that use an 'Authorization' header. This
means OkHttp's cache shouldn't be used on middleboxes that sit between
user agents and the origin server; in practice this is never a use case
for OkHttp.

Fixes https://github.com/square/okhttp/issues/1035
2014-11-01 11:53:13 -04:00
Jesse Wilson
f80b1f3a4a Fix a bug where the response cache could be corrupted.
When streaming a response, we copy data from our buffer to the cached file
on disk. Unfortunately we were copying N bytes from the front of the buffer
when we wanted N bytes from the back of the buffer.

Typically these are the same, but certain access patterns can cause them
to be different, corrpting the cached file on disk.

This was uncovered by migrating the cache tests from operating on
HttpURLConnection's API to our new API.
2014-10-27 11:00:01 -04:00
Jake Wharton
3a4c135529 Convert disk cache to use Okio. 2014-08-17 23:46:27 -07:00
Miguel Lavigne
7d5c42a1b2 Fixes the do not follow redirects bug
The HttpEngine would not obey the set state because there was no
correlation between the HttpURLConnection.setInstanceFollowRedirects
method and the OkHttpClient.

Fixed the missing link by adding a new setFollowRedirects method to the
OkHttpClient class.  Bridged the gap for the HttpURLConnection.setInstanceFollowRedirects
by forwarding that state into the OkHttpClient.

Now the HttpEngine will always obey the OkHttpClient redirect state when
attempting the followUp phase.

Added necessary test to both OkUrlFactoryTest and CallTest.

https://github.com/square/okhttp/issues/943
2014-06-24 07:45:09 -04:00
Jake Wharton
cdd71f1bbd Update the language level to Java 7. 2014-06-17 13:36:42 -07:00
Jesse Wilson
bdb5c2f4e9 Don't include a weird user-agent in the new API. 2014-06-10 22:26:07 -04:00
Jesse Wilson
baba1c090d Make the content type optional.
https://github.com/square/okhttp/issues/899
2014-06-08 11:29:41 -04:00
Jake Wharton
32c75ea09f Merge pull request #874 from square/jw/response-source-header
Expose backwards-compatible response source header.
2014-05-29 22:01:21 -07:00
Jake Wharton
e31b737763 Expose backwards-compatible response source header. 2014-05-29 21:58:21 -07:00
Jake Wharton
8f6a21e864 Restore Java 7-specific override annotation.
We require Java 7 to build now and this doesn't affect Java 6 at runtime.
2014-05-29 13:52:36 -07:00
Adrian Cole
5648a6868d In HttpURLConnection, pay attention when fixedContentLength is set to zero. 2014-05-22 08:48:40 -07:00
Jesse Wilson
ed70981925 Strip auth headers when redirected to another host.
These are potentially private and we don't want to leak them to another
host, regardless of whether they're created by the calling application or
by the Authenticator.
2014-05-19 23:18:07 -04:00
Jesse Wilson
22a03b59fa Drop ResponseSource. 2014-05-19 11:01:22 -04:00
Jesse Wilson
0676d8b173 Move code to the urlconnection module.
We don't need this code for the core OkHttp API.
2014-05-17 21:00:46 -04:00
Jesse Wilson
271cc7b632 First steps at making URLConnection a shim.
This extracts the URLConnection APIs to their own project. I still need to
go back and clean up some names in tests, add documentation, and move the
actual HttpURLConnection implementation details into this module.
2014-05-17 18:40:01 -04:00