diff --git a/CHANGELOG.md b/CHANGELOG.md index 5309abc98..68cc8fb9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,43 @@ Change Log ========== +## Version 4.4.0 + +_2020-02-17_ + + * New: Support `canceled()` as an event that can be observed by `EventListener`. This should be + useful for splitting out canceled calls in metrics. + + * New: Publish a [bill of materials (BOM)][bom] for OkHttp. Depend on this from Gradle or Maven to + keep all of your OkHttp artifacts on the same version, even if they're declared via transitive + dependencies. You can even omit versions when declaring other OkHttp dependencies. + + ```kotlin + dependencies { + api(platform("com.squareup.okhttp3:okhttp-bom:4.4.0")) + api("com.squareup.okhttp3:okhttp") // No version! + api("com.squareup.okhttp3:logging-interceptor") // No version! + } + ``` + + * New: Upgrade to Okio 2.4.3. + + ```kotlin + implementation("com.squareup.okio:okio:2.4.3") + ``` + + * Fix: Limit retry attempts for HTTP/2 `REFUSED_STREAM` and `CANCEL` failures. + * Fix: Retry automatically when incorrectly sharing a connection among multiple hostnames. OkHttp + shares connections when hosts share both IP addresses and certificates, such as `squareup.com` + and `www.squareup.com`. If a server refuses such sharing it will return HTTP 421 and OkHttp will + automatically retry on an unshared connection. + * Fix: Don't crash if a TLS tunnel's response body is truncated. + * Fix: Don't track unusable routes beyond their usefulness. We had a bug where we could track + certain bad routes indefinitely; now we only track the ones that could be necessary. + * Fix: Defer proxy selection until a proxy is required. This saves calls to `ProxySelector` on + calls that use a pooled connection. + + ## Version 4.3.1 _2020-01-07_ @@ -216,6 +253,7 @@ _2019-06-03_ [Change log](http://square.github.io/okhttp/changelog_3x/) + [bom]: https://docs.gradle.org/6.2/userguide/platforms.html#sub:bom_import [iana_websocket]: https://www.iana.org/assignments/websocket/websocket.txt [okhttp4_blog_post]: https://cashapp.github.io/2019-06-26/okhttp-4-goes-kotlin [upgrading_to_okhttp_4]: https://square.github.io/okhttp/upgrading_to_okhttp_4/ diff --git a/README.md b/README.md index 9886cb495..105ecbc96 100644 --- a/README.md +++ b/README.md @@ -99,10 +99,10 @@ Releases Our [change log][changelog] has release history. -The latest release is available on [Maven Central](https://search.maven.org/artifact/com.squareup.okhttp3/okhttp/4.3.1/jar). +The latest release is available on [Maven Central](https://search.maven.org/artifact/com.squareup.okhttp3/okhttp/4.4.0/jar). ```kotlin -implementation("com.squareup.okhttp3:okhttp:4.3.1") +implementation("com.squareup.okhttp3:okhttp:4.4.0") ``` Snapshot builds are [available][snap]. [R8 and ProGuard][r8_proguard] rules are available. @@ -113,10 +113,10 @@ MockWebServer OkHttp includes a library for testing HTTP, HTTPS, and HTTP/2 clients. -The latest release is available on [Maven Central](https://search.maven.org/artifact/com.squareup.okhttp3/mockwebserver/4.3.1/jar). +The latest release is available on [Maven Central](https://search.maven.org/artifact/com.squareup.okhttp3/mockwebserver/4.4.0/jar). ```kotlin -testImplementation("com.squareup.okhttp3:mockwebserver:4.3.1") +testImplementation("com.squareup.okhttp3:mockwebserver:4.4.0") ``` License diff --git a/build.gradle b/build.gradle index 553430f7b..1b7ff7cfd 100644 --- a/build.gradle +++ b/build.gradle @@ -90,7 +90,7 @@ ext.publishedArtifactId = { project -> allprojects { group = 'com.squareup.okhttp3' project.ext.artifactId = rootProject.ext.publishedArtifactId(project) - version = '4.4.0-SNAPSHOT' + version = '4.4.0' repositories { mavenCentral() @@ -269,6 +269,8 @@ subprojects { project -> from components.java } pom { + name = project.name + description = 'Square’s meticulous HTTP client for Java and Kotlin.' url = 'https://square.github.io/okhttp/' licenses { license { @@ -276,6 +278,11 @@ subprojects { project -> url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' } } + developers { + developer { + name = 'Square, Inc.' + } + } scm { connection = 'scm:git:https://github.com/square/okhttp.git' developerConnection = 'scm:git:ssh://git@github.com/square/okhttp.git' @@ -284,6 +291,17 @@ subprojects { project -> } } } + + repositories { + maven { + name = "mavencentral" + url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + credentials { + username System.getenv('SONATYPE_NEXUS_USERNAME') + password System.getenv('SONATYPE_NEXUS_PASSWORD') + } + } + } } signing { diff --git a/docs/releasing.md b/docs/releasing.md index 629c8c9e2..873681b3b 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -86,7 +86,7 @@ Cutting a Release sed -i "" \ "s/\/com.squareup.okhttp3\/\([^\:]*\)\/[^\/]*\//\/com.squareup.okhttp3\/\1\/$RELEASE_VERSION\//g" \ `find . -name "README.md"` - ./gradlew clean uploadArchives + ./gradlew clean publishAllPublicationsToMavencentralRepository ``` 5. Visit [Sonatype Nexus][sonatype_nexus] to promote (close then release) the artifact. Or drop it diff --git a/mockwebserver/README.md b/mockwebserver/README.md index f162b86df..4cc56a7e8 100644 --- a/mockwebserver/README.md +++ b/mockwebserver/README.md @@ -142,7 +142,7 @@ server.setDispatcher(dispatcher); ### Download ```kotlin -testImplementation("com.squareup.okhttp3:mockwebserver:4.3.1") +testImplementation("com.squareup.okhttp3:mockwebserver:4.4.0") ``` ### License diff --git a/okhttp-brotli/README.md b/okhttp-brotli/README.md index 1421ee1ed..e45a6670a 100644 --- a/okhttp-brotli/README.md +++ b/okhttp-brotli/README.md @@ -14,7 +14,7 @@ OkHttpClient client = new OkHttpClient.Builder() ``` ```kotlin -implementation("com.squareup.okhttp3:okhttp-brotli:4.3.1") +implementation("com.squareup.okhttp3:okhttp-brotli:4.4.0") ``` [1]: https://github.com/google/brotli diff --git a/okhttp-dnsoverhttps/README.md b/okhttp-dnsoverhttps/README.md index 5ebb6ceae..04365c015 100644 --- a/okhttp-dnsoverhttps/README.md +++ b/okhttp-dnsoverhttps/README.md @@ -7,5 +7,5 @@ API is not considered stable and may change at any time. ### Download ```kotlin -testImplementation("com.squareup.okhttp3:okhttp-dnsoverhttps:4.3.1") +testImplementation("com.squareup.okhttp3:okhttp-dnsoverhttps:4.4.0") ``` diff --git a/okhttp-logging-interceptor/README.md b/okhttp-logging-interceptor/README.md index af3a206f3..8d234ec89 100644 --- a/okhttp-logging-interceptor/README.md +++ b/okhttp-logging-interceptor/README.md @@ -37,7 +37,7 @@ Download -------- ```kotlin -implementation("com.squareup.okhttp3:logging-interceptor:4.3.1") +implementation("com.squareup.okhttp3:logging-interceptor:4.4.0") ``` diff --git a/okhttp-sse/README.md b/okhttp-sse/README.md index 19ad0be08..8d5c0f455 100644 --- a/okhttp-sse/README.md +++ b/okhttp-sse/README.md @@ -7,5 +7,5 @@ API is not considered stable and may change at any time. ### Download ```kotlin -testImplementation("com.squareup.okhttp3:okhttp-sse:4.3.1") +testImplementation("com.squareup.okhttp3:okhttp-sse:4.4.0") ``` diff --git a/okhttp-tls/README.md b/okhttp-tls/README.md index 1592af99c..7e806f85f 100644 --- a/okhttp-tls/README.md +++ b/okhttp-tls/README.md @@ -227,7 +227,7 @@ Download -------- ```kotlin -implementation("com.squareup.okhttp3:okhttp-tls:4.3.1") +implementation("com.squareup.okhttp3:okhttp-tls:4.4.0") ``` [held_certificate]: http://square.github.io/okhttp/4.x/okhttp-tls/okhttp3.tls/-held-certificate/ diff --git a/okhttp-urlconnection/README.md b/okhttp-urlconnection/README.md index 588fd8eed..50eeb0c44 100644 --- a/okhttp-urlconnection/README.md +++ b/okhttp-urlconnection/README.md @@ -6,5 +6,5 @@ This module integrates OkHttp with `Authenticator` and `CookieHandler` from `jav ### Download ```kotlin -testImplementation("com.squareup.okhttp3:okhttp-urlconnection:4.3.1") +testImplementation("com.squareup.okhttp3:okhttp-urlconnection:4.4.0") ```