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

125 Commits

Author SHA1 Message Date
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
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
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
Jesse Wilson
955934836f Merge remote-tracking branch 'nfuller/ChangeAlpnNpnSupport' into nfuller_ChangeAlpnNpnSupport
* nfuller/ChangeAlpnNpnSupport:
  Remove NPN support from OkHttp

Conflicts:
	okhttp/src/main/java/com/squareup/okhttp/Protocol.java
	pom.xml
2014-12-26 18:12:57 -05:00
Jesse Wilson
aa84d51fb2 Merge pull request #1231 from square/jw/test-method
Move method to test module, its only place of use.
2014-12-24 15:04:16 -05:00
Jake Wharton
1cabb0f58e Move method to test module, its only place of use. 2014-12-24 12:02:29 -08:00
Jake Wharton
15c81fdfc2 Normalize caching size in loop-local variable.
This was present in a bunch of loops, but not all and not consistently. After fixing two, I figured that I would normalize them all under the umbrella of uniformity and being lazy (only lookup up the value once if it never changes).
2014-12-24 11:33:14 -08:00
Jake Wharton
53ba84f06d Update MWS test style to match project. 2014-12-21 03:16:23 -08:00
Neil Fuller
4d068212aa Remove NPN support from OkHttp
Work in progress.

I see a new failure from a certificate pinning test but I don't
know why. Help solving this would be appreciated.

I also see failures before & after:
1) A failure from DisconnectTest
(https://github.com/square/okhttp/pull/1197 may fix that).
2) A failure from CallTest.doesNotFollow21Redirects_Async (timeout)

The maven changes should be treated with the contempt they deserve.
I mostly removed things I didn't understand and stroked maven until
it stopped squealing. The benchmarks / okcurl changes are a
particular mystery.

Tried with arbitrary versions of openjdk7 and openjdk8 I had
lying around. Behavior was the same across both (i.e. the same
failures).
2014-12-15 14:29:08 +00:00
mruddy
b78030a630 bind specifically to a loopback interface 2014-12-12 09:48:16 -05:00
Jesse Wilson
6167f0be1f Merge pull request #1174 from square/jw/froyo-melted
We no longer support Froyo.
2014-11-30 12:52:58 -05:00
Jake Wharton
a89e492c10 Null reference to allow multiple shutdown calls.
The shutdown command was looking for a null reference in order to early return but nobody was nulling the reference.
2014-11-30 03:26:27 -08:00
Jake Wharton
28a2695e2b We no longer support Froyo. 2014-11-30 02:37:36 -08:00
Jesse Wilson
361b391ef4 Merge pull request #1169 from nfuller/FixTestOnAndroid4
Fix tests that fail on some Android devices
2014-11-27 21:42:40 -05:00