Skip to content

Commit d2dd180

Browse files
committed
Prepare for release 5.1.0.
1 parent 61a8735 commit d2dd180

File tree

13 files changed

+30
-16
lines changed

13 files changed

+30
-16
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ Change Log
55

66
See [4.x Change log](https://square.github.io/okhttp/changelogs/changelog_4x/) for the stable version changelogs.
77

8+
## Version 5.1.0
9+
10+
_2025-07-07_
11+
12+
* New: `Response.peekTrailers()`. When we changed `Response.trailers()` to block instead of
13+
throwing in 5.0.0, we inadvertently removed the ability for callers to peek the trailers
14+
(by catching the `IllegalStateException` if they weren't available). This new API restores that
15+
capability.
16+
17+
* Fix: Don't crash on `trailers()` if the response doesn't have a body. We broke [Retrofit] users
18+
who read the trailers on the `raw()` OkHttp response, after its body was decoded.
19+
20+
821
## Version 5.0.0
922

1023
_2025-07-02_
@@ -630,6 +643,7 @@ release is the version name.
630643
[GraalVM]: https://www.graalvm.org/
631644
[Gradle module metadata]: https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html
632645
[Ktor]: https://ktor.io/
646+
[Retrofit]: https://square.github.io/retrofit/
633647
[annotation_1_9_1]: https://developer.android.com/jetpack/androidx/releases/annotation#annotation-1.9.1
634648
[assertk]: https://github.com/willowtreeapps/assertk
635649
[coroutines_1_10_2]: https://github.com/Kotlin/kotlinx.coroutines/releases/tag/1.10.2

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ Releases
120120

121121
Our [change log][changelog] has release history.
122122

123-
The latest release is available on [Maven Central](https://search.maven.org/artifact/com.squareup.okhttp3/okhttp/5.0.0/jar).
123+
The latest release is available on [Maven Central](https://search.maven.org/artifact/com.squareup.okhttp3/okhttp/5.1.0/jar).
124124

125125
```kotlin
126-
implementation("com.squareup.okhttp3:okhttp:5.0.0")
126+
implementation("com.squareup.okhttp3:okhttp:5.1.0")
127127
```
128128

129129
Snapshot builds are [available][snap]. [R8 and ProGuard][r8_proguard] rules are available.
@@ -133,7 +133,7 @@ Also, we have a [bill of materials (BOM)][bom] available to help you keep OkHttp
133133
```kotlin
134134
dependencies {
135135
// define a BOM and its version
136-
implementation(platform("com.squareup.okhttp3:okhttp-bom:5.0.0"))
136+
implementation(platform("com.squareup.okhttp3:okhttp-bom:5.1.0"))
137137

138138
// define any required OkHttp artifacts without version
139139
implementation("com.squareup.okhttp3:okhttp")
@@ -146,10 +146,10 @@ MockWebServer
146146

147147
OkHttp includes a library for testing HTTP, HTTPS, and HTTP/2 clients.
148148

149-
The latest release is available on [Maven Central](https://search.maven.org/artifact/com.squareup.okhttp3/mockwebserver/5.0.0/jar).
149+
The latest release is available on [Maven Central](https://search.maven.org/artifact/com.squareup.okhttp3/mockwebserver/5.1.0/jar).
150150

151151
```kotlin
152-
testImplementation("com.squareup.okhttp3:mockwebserver3:5.0.0")
152+
testImplementation("com.squareup.okhttp3:mockwebserver3:5.1.0")
153153
```
154154

155155
MockWebServer is used for firstly for internal testing, and for basic testing of apps using OkHttp client.

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ configure<SpotlessExtension> {
5252

5353
allprojects {
5454
group = "com.squareup.okhttp3"
55-
version = "5.1.0-SNAPSHOT"
55+
version = "5.1.0"
5656

5757
repositories {
5858
mavenCentral()

mockwebserver-junit4/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This module integrates mockwebserver3.MockWebServer with JUnit 4.
66
To use, first add this library as a test dependency:
77

88
```
9-
testImplementation("com.squareup.okhttp3:mockwebserver3-junit4:5.0.0")
9+
testImplementation("com.squareup.okhttp3:mockwebserver3-junit4:5.1.0")
1010
```
1111

1212
Then in tests annotated `@org.junit.Test`, you may declare a field with the `@Rule` annotation:

mockwebserver-junit5/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This module integrates mockwebserver3.MockWebServer with JUnit 5.
66
To use, first add this library as a test dependency:
77

88
```
9-
testImplementation("com.squareup.okhttp3:mockwebserver3-junit5:5.0.0")
9+
testImplementation("com.squareup.okhttp3:mockwebserver3-junit5:5.1.0")
1010
```
1111

1212
Annotate fields in test classes with `@StartStop`. The server will be started and shut down

mockwebserver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ server.setDispatcher(dispatcher);
142142
### Download
143143

144144
```kotlin
145-
testImplementation("com.squareup.okhttp3:mockwebserver3:5.0.0")
145+
testImplementation("com.squareup.okhttp3:mockwebserver3:5.1.0")
146146
```
147147

148148
### License

okhttp-brotli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ OkHttpClient client = new OkHttpClient.Builder()
1414
```
1515

1616
```kotlin
17-
implementation("com.squareup.okhttp3:okhttp-brotli:5.0.0")
17+
implementation("com.squareup.okhttp3:okhttp-brotli:5.1.0")
1818
```
1919

2020
[1]: https://github.com/google/brotli

okhttp-dnsoverhttps/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This module is an implementation of [DNS over HTTPS][1] using OkHttp.
66
### Download
77

88
```kotlin
9-
testImplementation("com.squareup.okhttp3:okhttp-dnsoverhttps:5.0.0")
9+
testImplementation("com.squareup.okhttp3:okhttp-dnsoverhttps:5.1.0")
1010
```
1111

1212
### Usage

okhttp-java-net-cookiejar/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ This used to be part of `okhttp-urlconnection`
77
### Download
88

99
```kotlin
10-
testImplementation("com.squareup.okhttp3:okhttp-java-net-cookiehandler:5.0.0")
10+
testImplementation("com.squareup.okhttp3:okhttp-java-net-cookiehandler:5.1.0")
1111
```

okhttp-logging-interceptor/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Download
3737
--------
3838

3939
```kotlin
40-
implementation("com.squareup.okhttp3:logging-interceptor:5.0.0")
40+
implementation("com.squareup.okhttp3:logging-interceptor:5.1.0")
4141
```
4242

4343

0 commit comments

Comments
 (0)