1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-12 10:23:16 +03:00
Commit Graph

5947 Commits

Author SHA1 Message Date
Jesse Wilson
d2dd180697 Prepare for release 5.1.0. parent-5.1.0 2025-07-07 15:32:33 -04:00
Jesse Wilson
61a87359f6 New Response.peekTrailers() API (#8921)
* New Response.peekTrailers() API

This restores behavior we had in OkHttp 4.x that I
broke when I changed Response.trailers() to block
until trailers were available.

Closes: https://github.com/square/okhttp/issues/8916

* apiDump

---------

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-07-07 14:57:05 -04:00
renovate[bot]
66844010f7 Update dependency gradle to v8.14.3 (#8915)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-04 12:52:10 -04:00
renovate[bot]
7adb2b637c Update junit-framework monorepo (#8914)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-04 15:51:26 +01:00
Yuri Schimke
e41ff18df8 Link to new mockwebserver artifacts (#8911) 2025-07-04 09:56:14 -04:00
Yuri Schimke
0ff87513e2 Remove Graal init tracing (#8909) 2025-07-04 09:35:42 +01:00
Yuri Schimke
b9a2560e56 Run graal on master (#8907) 2025-07-04 09:23:51 +01:00
Yuri Schimke
8339524463 Remove ExperimentalOkHttpApi references (#8908) 2025-07-04 09:17:35 +01:00
Yuri Schimke
ce29ef6182 Fix graal tests (#8906) 2025-07-04 09:15:11 +01:00
Jesse Wilson
85796896c3 Don't force a response body read on all trailers (#8904)
We only need to read the response body if its coming
from a real server.

Closes: https://github.com/square/okhttp/issues/8902

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-07-03 18:30:30 -04:00
Jesse Wilson
55a2c44489 Prepare next development version. 2025-07-03 10:43:34 -04:00
Jesse Wilson
1b703d52a9 Prepare for release 5.0.0. parent-5.0.0 2025-07-03 10:43:08 -04:00
Kartikaya Gupta (kats)
dcb640c3da Fix breaking change from alpha.17 release (#8899)
The semantics of the old path property included the query string,
and should be mapped from the new `target` which is the equivalent
field in the new recorded request. Using url.encodedPath only
provides the path component and omits the query component, resulting
in a breaking change.
2025-07-03 09:16:34 -04:00
Jesse Wilson
75661d41cd Fix a NoSuchMethodError loading OkHttp on Android (#8898)
The Sentry SDK assumes things in our public API that it
shouldn't be assuming. Oh well.

Closes: https://github.com/square/okhttp/issues/8826
2025-07-02 23:59:03 -04:00
renovate[bot]
a84a09f0fa Update com.squareup.okio to v3.15.0 (#8896)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-01 22:37:39 -04:00
renovate[bot]
06a88ad51f Update dependency com.gradleup.shadow:shadow-gradle-plugin to v8.3.8 (#8895)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-01 19:18:48 +01:00
Jesse Wilson
9ba896295a Document change of RecordedRequest.path 2025-06-30 14:05:39 -04:00
renovate[bot]
2864541d51 Update dependency com.puppycrawl.tools:checkstyle to v10.26.1 (#8894)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-29 18:11:19 -04:00
Jesse Wilson
4309b5554e Prepare next development version. 2025-06-29 12:57:43 -04:00
Jesse Wilson
ae1145c22d Prepare for release 5.0.0-alpha.17. parent-5.0.0-alpha.17 2025-06-29 12:57:15 -04:00
renovate[bot]
dba12fc5a6 Update dependency de.mannodermaus.gradle.plugins:android-junit5 to v1.13.1.0 (#8892)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-28 23:13:02 -04:00
renovate[bot]
dbefb8001d Update testcontainers-java monorepo to v1.21.3 (#8893)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-28 23:03:40 -04:00
renovate[bot]
b14aa252b2 Update com.squareup.okio to v3.14.0 (#8891)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-28 15:43:09 -04:00
renovate[bot]
9bb23fcbd2 Update kotlinx.serialization to v1.9.0 (#8889)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-27 13:35:08 -04:00
renovate[bot]
4a7f993f6e Update dependency net.ltgt.gradle:gradle-errorprone-plugin to v4.3.0 (#8888)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-26 15:41:26 +01:00
renovate[bot]
5365bd4cd7 Update dependency com.google.devtools.ksp:symbol-processing-gradle-plugin to v2.2.0-2.0.2 (#8887)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-26 06:18:22 +01:00
renovate[bot]
5a37937a02 Update dependency org.jetbrains.kotlinx.binary-compatibility-validator:org.jetbrains.kotlinx.binary-compatibility-validator.gradle.plugin to v0.18.0 (#8886)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-25 16:35:12 +01:00
renovate[bot]
d6e9fb8165 Update dependency com.android.tools.build:gradle to v8.11.0 (#8885)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-24 15:19:30 -04:00
renovate[bot]
931a762fd3 Update junit.platform to v1.13.2 (#8881)
* Update dependency org.junit.platform:junit-platform-console to v1.13.2

* Update dependency org.junit.vintage:junit-vintage-engine to v5.13.2 (#8882)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-24 14:59:35 -04:00
renovate[bot]
3256bdec2b Update dependency com.puppycrawl.tools:checkstyle to v10.26.0 (#8884)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-24 18:03:11 +01:00
renovate[bot]
d48fbacf37 Update dependency com.gradleup.shadow:shadow-gradle-plugin to v8.3.7 (#8879)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-24 00:18:18 -04:00
Zxilly
2f78681a1f Update rfc document link (#8877)
as old link points to 404 now.
2025-06-23 14:58:57 -04:00
renovate[bot]
9dda461c23 Update kotlin monorepo to v2.2.0 (#8878)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-23 13:38:19 -04:00
renovate[bot]
552d06fdfe Update dependency org.jsoup:jsoup to v1.21.1 (#8876)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-23 06:25:41 +01:00
renovate[bot]
5eaa8603d2 Update dependency com.vanniktech:gradle-maven-publish-plugin to v0.33.0 (#8875)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-22 15:00:49 -04:00
renovate[bot]
612f8251b9 Update dependency org.robolectric:robolectric to v4.15.1 (#8874)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-22 01:00:12 -04:00
Jesse Wilson
4d0986be40 Change RecordedRequest.chunkSizes to be nullable (#8872)
* Change RecordedRequest.chunkSizes to be nullable

Now that it's all Kotlin we can usefully distinguish
between null (not chunked) and empty list (chunked with
zero bytes).

Also remove the experimental annotation from RecordedRequest
and delete the experimental annotation.

* apiDump

---------

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-06-21 16:36:35 -04:00
renovate[bot]
f83759ebe9 Update dependency com.puppycrawl.tools:checkstyle to v10.25.1 (#8873)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-21 14:41:12 -04:00
renovate[bot]
5c4de2b361 Update dependency org.robolectric:robolectric to v4.15 (#8871)
* Update dependency org.robolectric:robolectric to v4.15
* Skip test on early robolectric

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Yuri Schimke <yuri@schimke.ee>
2025-06-21 10:51:07 +01:00
Jesse Wilson
f745695087 Replace SocketPolicy with a new type, SocketEffect (#8870)
* Replace SocketPolicy with a new type, SocketEffect

SocketPolicy encapsulated two things:
 - a trigger (request start, response body, etc)
 - an effect (close the socket, close the stream, stall, etc.)

It also had some special cases for effects like
failing the TLS handshake.

With this PR there's a new class, SocketEffect, that determines
what to do. It's assigned to one of 5 fields for different
triggers.

# Conflicts:
#	mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

* apiDump

* Track API change

* Track more API changes

* Spotless

---------

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-06-20 07:46:46 -04:00
Jesse Wilson
0a902f3d28 Use HTTP/2 in RecordedRequest (#8869) 2025-06-19 23:33:28 -04:00
Jesse Wilson
36ed3452fe Add a connectionIndex field to RecordedRequest (#8866)
Also rename 'sequenceNumber' to 'exchangeIndex'.
This may be useful to test features like connection
reuse.

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-06-19 07:44:16 -04:00
Jesse Wilson
570277976d Stop using experimental coroutines APIs (#8867)
They're stable now.

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-06-19 00:20:30 -04:00
renovate[bot]
dd70d9e579 Update testcontainers-java monorepo to v1.21.2 (#8868)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-18 23:19:00 -04:00
Jesse Wilson
935534dca4 Permit RecordedRequest.body to be null or empty (#8865)
* Permit RecordedRequest.body to be null or empty

Null if we didn't capture a body, and empty if we
captured an empty body.

* Track API change

* Fixup more tests

* spotless

---------

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-06-18 11:13:15 -04:00
Jesse Wilson
dddc93842c Drop the parameters-based JUnit 5 extension (#8864)
* New @StartStop extension for JUnit 5

This is a new take on our JUnit 5 extension. Rather than creating and managing
the MockWebServer instance in the extension, we let the user create it and all
the extension does is manage the lifecycle.

Note that this annotation doesn't require any external configuration - it doesn't
need a system-property to opt-into 'automatic' extensions, and it doesn't require
a class-level extension either.

* apiDump

* Switch to @StartStop for JUnit 5 tests

* Fixup visibility

* Drop the parameters-based JUnit 5 extension

I think the @StartStop one is sufficient.

---------

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-06-18 08:28:34 -04:00
Jesse Wilson
5f3ec584f7 Switch to @StartStop for JUnit 5 tests (#8863)
* New @StartStop extension for JUnit 5

This is a new take on our JUnit 5 extension. Rather than creating and managing
the MockWebServer instance in the extension, we let the user create it and all
the extension does is manage the lifecycle.

Note that this annotation doesn't require any external configuration - it doesn't
need a system-property to opt-into 'automatic' extensions, and it doesn't require
a class-level extension either.

* apiDump

* Switch to @StartStop for JUnit 5 tests

* Fixup visibility

---------

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-06-18 08:28:21 -04:00
Jesse Wilson
5659f0fe38 New @StartStop extension for JUnit 5 (#8862)
* New @StartStop extension for JUnit 5

This is a new take on our JUnit 5 extension. Rather than creating and managing
the MockWebServer instance in the extension, we let the user create it and all
the extension does is manage the lifecycle.

Note that this annotation doesn't require any external configuration - it doesn't
need a system-property to opt-into 'automatic' extensions, and it doesn't require
a class-level extension either.

* apiDump

---------

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-06-18 07:13:17 -04:00
Jesse Wilson
b9a1a5dd80 Change some MockWebServer ergonomics (#8861)
* Change some MockWebServer ergonomics

Now calling MockWebServer.port and similar functions will
not implicity start the server. It is instead necessary to
explicitly call the start() function.

The problem with the old behavior was that reading the
port field could fail with an IOException, which is weird
behavior for reading a property.

* Fixup test

* Fix another test

---------

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-06-17 20:19:42 -04:00
Jesse Wilson
dfd1dffb3c Decompose the request line into individual properties (#8860)
* Decompose the request line into individual properties

Replace the 'path' property with the URL's encodedPath
property.

Rename the 'requestUrl' property to 'url'.

* Spotless

* Fix up DnsOverHttpsTest

* Fix some test failures
2025-06-16 20:47:36 -04:00