1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-18 20:40:58 +03:00
Commit Graph

1368 Commits

Author SHA1 Message Date
Neil Fuller
aaf2695b00 Fix ResponseCacheTest for Android
Pull #1011 broke ResponseCacheTest on Android.

The test was asserting a header generated
using a copy of the old broken implementation.

The test now just uses HttpDate, which now has its own
tests.
2014-08-06 14:04:06 +01:00
Jesse Wilson
2a914f09d3 Merge branch 'master' of github.com:square/okhttp
* 'master' of github.com:square/okhttp:
  Add a regression test for transparent gzip + basic auth
2014-08-05 09:06:29 -07:00
Tomasz Rozbicki
fb93a578ee Allow duplicated charsets in MediaType 2014-08-05 09:05:54 -07:00
Jesse Wilson
68fcca30b4 Merge pull request #1010 from nfuller/TransparentGzipTest
Add a regression test for transparent gzip + basic auth
2014-08-05 09:03:03 -07:00
Jesse Wilson
5bc7de1f49 Merge pull request #1011 from nfuller/FixParseFormat2
Fix formatting / parsing for Android
2014-08-01 11:55:43 -04:00
Neil Fuller
b36761b7dd Fix formatting / parsing for Android
Ensuring that this Android bug is fixed for the next
Android release:
https://code.google.com/p/android/issues/detail?id=66135

On Android the SimpleDateFormat for "zzz" returns GMT+00:00.
This is regrettable but awkward to change as it is existing
behavior.
https://code.google.com/p/android/issues/detail?id=66136

This change fixes the format to 'GMT'.

This change also fixes a bug where the platform default
timezone was used for parsing some date/times and not GMT.

Various tests have been added to prove the behavior when
timezones are missing and dates are malformed.
2014-08-01 10:49:56 +01:00
Neil Fuller
c376609738 Add a regression test for transparent gzip + basic auth
The bug is fixed but there wasn't an obvious test.
See report: https://code.google.com/p/android/issues/detail?id=74026
2014-07-31 11:33:01 +01:00
Jesse Wilson
b19860c929 Merge pull request #1002 from lcolitti/master
Allow callers to pass in a custom host resolver implementation.
2014-07-24 16:03:31 -04:00
Lorenzo Colitti
84f9a172f9 Allow callers to pass in a custom host resolver implementation.
An HTTP client interacts with the network in two main ways: DNS
lookups and connections to HTTP servers. OkHttp already abstracts
the latter by allowing callers to pass in custom SocketFactory
objects, but does not yet abstract the former.

This change takes the existing internal Dns interface, which is
currently used for testing, and turns it into a publicly
accessible HostResolver interface. This allows callers to
completely abstract all network interaction points.

Examples of what this can be used for:

1. Use alternative DNS implementations with different
   performance / caching / ordering / parallelization / ...
   characteristics than standard InetAddress.getAllByName.
2. Resolve hosts using different DNS servers than the system
   resolvers, or even non-DNS protocols (e.g., MDNS or even
   NetBIOS/WINS) that are not supported by the system resolver.
3. Do DNS lookups on specific networks, similarly to what
   android_getaddrinfofornet does.

Change-Id: I6e488acd938067e4c078c6ffe4d5eddb5f3951de
2014-07-25 03:26:42 +09:00
Jake Wharton
1031cce36a Merge pull request #1000 from seato/seato/issue-999-ignore-cookie-case
Cookies tests are flaky
2014-07-23 15:30:22 -07:00
Richard Thai
e2770dc2d3 The cookie domains that were being compared were not case-insensitive which caused some tests to fail. 2014-07-23 11:07:57 -07:00
Jesse Wilson
7f763c1a18 Merge pull request #997 from lcolitti/master
Use the socket factory for direct connections as well.
2014-07-22 20:17:38 -04:00
Lorenzo Colitti
6d9f9cbdf8 Use the socket factory for direct connections as well.
Currently, the passed-in socket factory is only used for
connections to HTTP proxies. I think this was not the intent of
the original socket factory change, because the commit message
said that the "socket factory will be used for all non-proxy
connections and HTTP proxy connections".  So use it for DIRECT
connections as well.

Also add a test to check that a socket factory is used if
specified.

Change-Id: I811b08442d1c80be1a0a268eb51c9aa365febf00
2014-07-22 04:34:02 +09:00
Jake Wharton
63d7562317 Merge pull request #996 from square/jwilson_0720_content-length-zero
Permit GETs to have Content-Length: 0.
2014-07-20 21:37:15 -07:00
Jesse Wilson
494afc1969 Permit GETs to have Content-Length: 0.
It's ridiculous, but Apache HTTP client wants it.
Closes https://github.com/square/okhttp/issues/990
2014-07-20 23:07:59 -04:00
Jesse Wilson
e6686f69b7 Merge pull request #976 from westarle/931-add-hpack-tests
Add hpack-test-case based tests
2014-07-18 01:41:46 -04:00
Jake Wharton
b478b58453 Merge pull request #989 from ChristianBecker/better-tostring
Use urlString for Request.toString()
2014-07-10 08:16:11 -07:00
Christian Becker
02bfad2945 Use urlString for Request.toString() 2014-07-10 17:03:45 +02:00
Jake Wharton
3fe0b271c1 Merge pull request #987 from ChristianBecker/trailing-crlf
Add trailing CRLF to multipart.
2014-07-09 15:11:18 -07:00
Christian Becker
5ca07ed955 Add trailing CRLF to multipart. 2014-07-09 08:59:51 +02:00
Wesley Tarle
ea13e5ec97 Add hpack-test-case test module.
Issue square/okhttp#931
2014-07-06 10:34:22 -07:00
Jesse Wilson
19f83f8d54 Merge pull request #949 from mlc/friendly_form_building
provide a friendlier API for multipart forms.
2014-07-04 08:15:20 -07:00
Jesse Wilson
53ff0101ee Merge pull request #980 from square/adrian.response-protocol
Use transport protocol in SPDY response
2014-07-02 09:21:28 -06:00
Jesse Wilson
d9e3e7dd33 Merge pull request #981 from square/adrian.http2-initial-window
HTTP/2 initial window size is 65535 not 65536
2014-07-02 09:20:54 -06:00
Adrian Cole
4c1436b3d6 HTTP/2 initial window size is 65535 not 65536. 2014-07-02 07:46:56 -07:00
Adrian Cole
9a35caf733 Use transport protocol in SPDY response. 2014-07-02 07:29:25 -07:00
mike castleman
a1c0872a34 provide a friendlier API for multipart forms.
Also, escape the name and filename tokens, and include some small
changes from CR.
2014-07-01 19:53:38 -04:00
Jesse Wilson
0766369844 Merge pull request #973 from square/jwilson_0628_nonfinal
Make it possible to mock OkHttpClient and Call.
2014-06-29 23:50:18 -06:00
Jesse Wilson
83e42cb928 Make it possible to mock OkHttpClient and Call.
Closes https://github.com/square/okhttp/issues/956
2014-06-29 23:46:41 -06:00
Jake Wharton
5468a73075 Merge pull request #972 from square/jwilson_0628_move_connect
Move connect to be closer to connection.
2014-06-28 19:26:32 -07:00
Jesse Wilson
7bb06e78ba Move connect to be closer to connection.
This eliminates some awkwardness in OkHttpClient, where it needs
to make a bunch of internal calls to Connection.
2014-06-28 08:57:41 -06:00
Jesse Wilson
2cf38851d2 Merge pull request #944 from MiguelLavigne/feature/mlavigne/fix_do_not_follow_redirects
Fixes the do not follow redirects bug
2014-06-28 08:44:43 -06:00
Jesse Wilson
e34ac14009 Merge pull request #970 from square/jw/java-seven
Mention correct Java version on the website.
2014-06-28 08:13:49 -06:00
Jesse Wilson
0673041a1b Merge pull request #971 from square/jw/appending-sink
Use Okio's appending sink for File.
2014-06-28 08:13:33 -06:00
Jake Wharton
3a8967322d Use Okio's appending sink for File. 2014-06-28 01:34:36 -07:00
Jake Wharton
cabd391637 Use HTML entity for ampersand. 2014-06-28 01:24:17 -07:00
Jake Wharton
58c7b68cbf Mention correct Java version on the website. 2014-06-28 01:24:06 -07:00
Jesse Wilson
d43ab24554 Merge pull request #895 from anderius/anderius_takerequest
Anderius takerequest with timeout
2014-06-25 02:27:50 -04:00
Jake Wharton
a53cecf5bf Import. 2014-06-24 10:12:29 -07:00
Jesse Wilson
82dc7265ab Merge pull request #961 from square/jw/eager-entry-files
Eagerly create Entry Files for every value.
2014-06-24 09:26:57 -04: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
f835806590 Eagerly create Entry Files for every value.
Through the various code paths that an Entry would pass through both the clean and dirty File would be needed at least once. Creating it and the StringBuilders every time was having a large impact on allocation in high-frequency situations (like images in an Android app).
2014-06-23 21:29:08 -07:00
Adrian Cole
1406379a33 Merge pull request #954 from square/adrian.http2draft13
Implement HTTP/2 Draft 13; HPACK Draft 08.
2014-06-22 14:56:06 -07:00
Adrian Cole
802b773994 Implement HTTP/2 Draft 13; HPACK Draft 08. 2014-06-21 21:44:12 -07:00
Jake Wharton
151d807944 Merge pull request #955 from square/jwilson_0621_fix_cache_method_typo
Fix a bug where the cacheResponse's request method was wrong.
2014-06-21 15:59:08 -07:00
Jesse Wilson
a87147e654 Fix a bug where the cacheResponse's request method was wrong.
We were returning the message (like 'OK') rather than the method
(like 'GET'). Ugh.
2014-06-21 18:28:50 -04:00
Jesse Wilson
c7934d2fd3 Merge branch 'okhttp_20'
* okhttp_20:
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release parent-2.0.0
2014-06-21 00:23:57 -04:00
Jesse Wilson
617f3abbe4 Merge pull request #953 from square/jw/unindent
Unindent the website samples.
2014-06-21 00:03:51 -04:00
Jake Wharton
55173ea4e6 Unindent the website samples. 2014-06-20 21:03:18 -07:00
Jesse Wilson
f2d5fcbd40 [maven-release-plugin] prepare for next development iteration 2014-06-21 00:02:22 -04:00