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

162 Commits

Author SHA1 Message Date
jwilson
5cc7dba3ad [maven-release-plugin] prepare release parent-2.4.0-RC1 2015-05-16 17:03:16 -04:00
jwilson
2b236fd66a Use HttpUrl in Request. 2015-05-12 13:39:20 -04:00
Hugo Gresse
bc2b45bc93 Update MockWebServer README with gradle and fix code.
commit 8b19e590642290938f42871ecedbc9b6a6cba679
Author: Hugo Gresse <hugo.gresse@gmail.com>
Date:   Wed Apr 29 09:11:58 2015 +0200

    Change MockWebServer readme start() to play()

commit fb165671ca3a958d1dd2c8a431e20d9f3e0db6a7
Author: Hugo Gresse <hugo.gresse@gmail.com>
Date:   Mon Apr 27 21:33:54 2015 +0200

    Change MockWebServer readme to not imply endorsement of Gradle

commit 9d7b044141970aba3a6c2384184938570ce8c728
Author: Hugo Gresse <hugo.gresse@gmail.com>
Date:   Mon Apr 27 17:22:45 2015 +0200

    Update MockWebServer README with gradle and fix code

    Add gradle as the recommanded download mode and remove unnecessary ")" for dispatcher example
2015-05-10 10:53:20 -04:00
Neil Fuller
4e08085cc8 Install an UncaughtExceptionHandler during tests
This is to make the tests more brittle around uncaught exceptions
as they are on Android. No uncaught exceptions should escape.
2015-04-14 16:55:26 +01:00
Lucas Albuquerque
e6f42c4263 Adding more content and example to Dispatcher 2015-03-31 22:01:45 -03:00
jwilson
0237d3c3f2 [maven-release-plugin] prepare for next development iteration 2015-03-16 22:28:12 -04:00
jwilson
c49eedeba3 [maven-release-plugin] prepare release parent-2.3.0 2015-03-16 22:28:09 -04:00
jwilson
3d0fb76bd5 Update SpdyServer.
Serves HTTP/2 without problems to the latest Firefox.
2015-03-14 21:42:09 -04:00
Jake Wharton
0b2ef95640 Move WebSocket to the public API in a sibling module. 2015-03-11 12:24:58 -04:00
Jake Wharton
8a1e6ceec9 Use the now-generalized reply executor for peer close. 2015-03-09 20:33:47 -04:00
jwilson
c25728dd79 Don't attempt to read a source after closing it.
Reported here: http://stackoverflow.com/questions/28931191/okhttp-urlconnection-test-crashes-mockwebserver-yet-passes/28934866#28934866
2015-03-08 23:45:47 -04:00
Jesse Wilson
f152f35b8b Merge pull request #1394 from nfuller/FixSubjectSn
Fix for SslContextBuilder/MockWebServer disagreeing about localhost
2015-03-07 18:17:17 -05:00
jwilson
c324114447 Don't crash on shutdown() before start().
Closes https://github.com/square/okhttp/issues/1372
2015-03-07 15:16:48 -05:00
jwilson
ef47c446a2 Use Okio's new APIs for number parsing and formatting. 2015-02-22 17:50:03 -05:00
Neil Fuller
353ec0b0cd Fix for SslContextBuilder/MockWebServer disagreeing about localhost
MockWebServer binds to getByName("localhost"), SslContextBuilder was using
InetAddress.getByName(null) (null == any loopback). On Android, null
returns IPv6 loopback, which has the name "ip6-localhost".
2015-02-12 09:47:03 +00:00
Brennan Taylor
c99ac2b462 Allow user to configure what mockwebserver binds to
Provide `start(InetSocketAddress)` and `start(InetAddress, port)` to
address #1342
2015-01-25 16:38:08 -08:00
Neil Fuller
0b69d29ba1 Fix for MockWebServer on Android
On Android L (and probably prior releases) it is necessary to
close a socket explicitly rather than relying on
InputStream/OutputStream to do it for you.

See bug here: https://code.google.com/p/android/issues/detail?id=97564
2015-01-15 10:37:00 +00:00
Neil Fuller
9877d1b4da Modify the way MockWebServer selects a host IP to bind to
On Android getByName(null) returns the first of
[IPv6 loopback, IPv4 loopback], binding the server to ::1.
The IPv6 loopback address returns "localhost". "localhost"
does not resolve to the IPv6 address.

Instead: explicitly select "localhost" ensuring
MockWebServer binds to an IP that can be looked up by name
and should also be a loopback address.
2015-01-13 13:44:20 +00:00
Jesse Wilson
933da4a430 Merge pull request #1297 from square/jw/mock-headers
Use 'Headers' in recorded response.
2015-01-07 19:32:35 -05:00
Jake Wharton
4ab6a8258b Remove old SSL protocol method. 2015-01-05 22:41:54 -08:00
Jake Wharton
c46b61d565 Use 'Headers' in recorded response. 2015-01-05 22:38:23 -08:00
Jake Wharton
8f54a48ea5 Clean up time-based APIs for throttle and delay. 2015-01-05 09:34:33 -08:00
Jesse Wilson
f84c2c022a Merge pull request #1290 from square/jw/start
Rename play to start.
2015-01-05 10:32:51 -05:00
Jesse Wilson
a5e13bd335 Merge pull request #1292 from square/jw/more-long
Time amounts should be longs.
2015-01-05 10:31:57 -05:00
Jesse Wilson
58dff54d1e Merge pull request #1293 from square/jw/zero
Take no action if transferring zero bytes.
2015-01-05 10:31:32 -05:00
Jesse Wilson
4ae1b23953 Merge pull request #1291 from square/jw/long-limit
Body limit should be long.
2015-01-05 10:30:40 -05:00
Jake Wharton
c5c4e7857c Expose Headers directly on MockResponse. 2015-01-05 00:42:01 -08:00
Jake Wharton
8e201297fe Update MockWebServer to use Headers. 2015-01-05 00:18:56 -08:00
Jake Wharton
5355762a6f Rename play to start. 2015-01-04 23:17:42 -08:00
Jake Wharton
9d4b4d9aea Take no action if transferring zero bytes.
This removes the logic from inside the loop for much better readability.
2015-01-04 23:10:27 -08:00
Jake Wharton
da95a56de7 Time amounts should be longs. 2015-01-04 22:56:13 -08:00
Jake Wharton
43abb40f6a Body limit should be long. 2015-01-04 22:53:05 -08:00
Jake Wharton
ddbf23693a Merge pull request #1286 from square/jw/response-body-source
Change MockResponse body to Source.
2015-01-04 22:05:58 -08:00
Jake Wharton
9a5670beec Change MockResponse body to Source. 2015-01-04 22:05:47 -08:00
Jesse Wilson
00a6bfff47 Merge pull request #1287 from square/jw/long-deprecated
Remove long-deprecated peek API.
2015-01-05 01:04:06 -05:00
Jake Wharton
cc7a26574d Correctly link to OkHttp and Okio javadoc. 2015-01-04 21:51:41 -08:00
Jake Wharton
6f232fdb6d Remove long-deprecated peek API. 2015-01-04 21:40:57 -08:00
Jake Wharton
f6c3ab9b16 Use Sources and Sinks for all IO. 2015-01-04 13:50:49 -08:00
Jake Wharton
8b0bdf3155 Teach MockWebServer to speak WebSockets. 2015-01-04 00:52:22 -08:00
Jake Wharton
7361b9a141 Prefer JUnit rules for temporary folders, MockWebServer. 2015-01-02 18:00:23 -08:00
Jesse Wilson
b2c657b157 Test Expect: 100-continue with OkHttp, not HttpURLConnection.
This test is flaky when relying on the platform's built-in
HttpURLConnectionImpl.

Instead, test it with OkHttp's API and implementation.
2015-01-02 17:57:41 -05:00
Jake Wharton
a8d11adf46 Fix the String representation of TlsVersion for RecordedRequest. 2015-01-02 14:22:43 -08:00
Jake Wharton
c3f5112d99 Make TlsVersion and CipherSuite parsing methods public. 2015-01-02 14:22:28 -08:00
Jake Wharton
8b6aa0dca5 Use a Buffer for body contents. 2015-01-02 14:03:25 -08:00
Jake Wharton
4a3226a711 Use TlsVersion enum for recorded requests. 2015-01-02 13:43:13 -08:00
Jesse Wilson
1d86439e90 [maven-release-plugin] prepare for next development iteration 2014-12-30 21:52:35 -05:00
Jesse Wilson
6aef5ab3c5 [maven-release-plugin] prepare release parent-2.2.0 2014-12-30 21:52:33 -05:00
Jesse Wilson
dcbb199247 Don't recover from timeouts.
Closes https://github.com/square/okhttp/issues/1146
2014-12-30 10:37:09 -05:00
Jesse Wilson
c6503d2604 Don't reuse ephemeral port numbers.
MockWebServer was reusing port numbers, and this was causing tests
to be flaky in some situations.
2014-12-29 14:25:23 -05:00
Jesse Wilson
785d9e9438 Use MockWebServerRule in more tests.
Also fix a bug in MockWebServer where calls to shutdown()
raced with calls to play() would throw a NullPointerException.

Also improve logging in MockWebServer.
2014-12-27 13:05:36 -05:00