1
0
mirror of https://github.com/square/okhttp.git synced 2025-09-11 18:10:47 +03:00

111 Commits

Author SHA1 Message Date
Yuri Schimke
bc5ad233f1 Bump robolectric to 4.16 (#9044)
* Bump robolectric

* test with 36

* avoid requiring JDK 21 for Robolectric tests
2025-08-30 17:25:39 +01:00
Benoît Quenaudon
0e0352920b Move the Android test README under the androidTest directory (#9031)
And opt-in to compile without errors
2025-08-22 09:12:58 +01:00
Benoît Quenaudon
929a41c01c Print URLs in HttpLoggingInterceptor when the call fails (#9030) 2025-08-21 15:27:04 +01:00
Yuri Schimke
67c1b8e419 Split android OkHttpClient tests. (#8991)
* Split android OkHttpClient tests.

current tests were using a single client then
testing real network (facebook, ...) and localhost insecure.

Split so we get clearer failures.
2025-08-02 15:12:28 +01:00
Yuri Schimke
3004abe400 okhttp3.Gzip (#8988)
* okhttp3.Gzip

Top level object for consistency.

* reformat and apis
2025-08-01 06:04:22 +00:00
Yuri Schimke
971101cacc Add reusable CompressionInterceptor (#8967)
* Add reusable CompressionInterceptor.kt

Refactor Brotli and Zstd to use this, but also
allow trivial configuration of zstd,br,gzip.
2025-07-29 20:01:04 +00:00
Yuri Schimke
07fe953b40 Add Android OkHttp.initialize(Context) (#8965)
* Add OkHttp.initialiseApplicationContext

A fallback for apps Disabling the AndroidX Startup Initialiser.
2025-07-28 08:33:49 +01:00
Yuri Schimke
50f1be974d Add test demonstrating topPrivateDomain on Robolectric (#8954)
* Add test demonstrating topPrivateDomain on Robolectric
* Handle non robo case
2025-07-22 21:03:31 +01: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
Yuri Schimke
24b8d2942c Add a test and fix for non-robolectric android test. (#8844)
If Robolectric not active, then unit tests for Android will fail annoyingly.
2025-06-07 11:09:33 +01:00
Jesse Wilson
8720aa82ce Temporarily stash the AsyncDns stuff (#8823)
It isn't used anywhere yet. I want to get back to this soon
but I don't want to release 5.0.0 final with any incomplete
APIs.

https://github.com/square/okhttp/issues/8318
2025-05-29 16:09:10 -04:00
Jesse Wilson
7513e02567 Fix a failing test by adding a FollowUpDecision event (#8809)
* Fix a failing test by adding a FollowUpDecision event

* Fix up the other events list

---------

Co-authored-by: Jesse Wilson <jwilson@squareup.com>
2025-05-27 14:52:42 -04:00
Jesse Wilson
0e7ec0bc1c Fix some missing copyright statements (#8789) 2025-05-22 10:39:30 -04:00
Yuri Schimke
f2640e0b08 Create a friends configuration to use internals. (#8651)
* Create a friends configuration to use internals.

From https://www.liutikas.net/2025/01/12/Kotlin-Library-Friends.html we should avoid using

@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")

So instead lets just be friends.
2025-05-10 12:15:14 +01:00
renovate[bot]
a51cfbf841 Update dependency com.diffplug.spotless:spotless-plugin-gradle to v7 (#8702)
* Update dependency com.diffplug.spotless:spotless-plugin-gradle to v7

* Reformat

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jake Wharton <jw@squareup.com>
2025-03-19 15:25:20 -04:00
renovate[bot]
c4d472cab7 Update dependency androidx.activity:activity-ktx to v1.10.1 (#8654)
* Update dependency androidx.activity:activity-ktx to v1.10.1

* compileSdk 35

* Update build.gradle.kts

* compileeeeeeeeeee

* Update build.gradle.kts

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jake Wharton <jw@squareup.com>
2025-03-17 11:11:24 -04:00
Yuri Schimke
9c653c7b0a Add a StrictMode noteSlowCall for SSL init (#8339)
Add strict mode checks on slow calls
2025-01-05 13:15:05 +00:00
Yuri Schimke
dd5a002d44 Use Assets or Resources based on platform. (#8636)
* Use Assets and Resources based on platform.

Assets uncompressed on Android. Assuming that the AAR file will compress.

Use Resources, compressed on JVM.
2024-12-31 16:50:53 +02:00
Yuri Schimke
1786dd70e7 Merge okhttp-android into okhttp (#8635)
* Merge okhttp-android into okhttp.

Since :okhttp is kmp, it isn't required to be separate. And also the okhttp-android/jvm artifact naming conflicts with it.
2024-12-31 01:28:56 +02:00
Yuri Schimke
5163d93806 Spotless bump (#8205)
* Update dependency com.diffplug.spotless:spotless-plugin-gradle to v6.24.0
* Spotless bump

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-20 10:30:28 +00:00
Yuri Schimke
a16dcecfeb Allow constructor injection of MockWebServer (#8191) 2024-01-14 10:20:09 +00:00
Jesse Wilson
a228fd64cc Reformat with Spotless (#8180)
* Enable spotless

* Run spotlessApply

* Fixup trimMargin

* Re-run spotlessApply
2024-01-07 20:13:22 -05:00
Jesse Wilson
ea735b03ff Attempt to fix the android-test build (#8178) 2024-01-06 21:31:24 -05:00
Yuri Schimke
a696d4d333 Fix android test targetSdk (#8158) 2023-12-24 06:39:41 +00:00
Jesse Wilson
c056530682 Switch back to the kotlin JVM plugin (#8149)
* Switch back to the kotlin JVM plugin

This does a ton of file moves from jvmMain to main, and jvmTest to test.

* Don't use AnimalSniffer on okcurl

* Use assertk more (#8150)
2023-12-20 18:27:07 -05:00
Yuri Schimke
2bed25879f Testing with ALPN Override (#8081) 2023-12-04 06:48:05 +00:00
Yuri Schimke
c309709dbd AGP 8 (#7918) 2023-07-09 12:08:42 +01:00
Yuri Schimke
b94da08568 Enable android-test by default (#7899) 2023-06-17 12:34:46 +01:00
Yuri Schimke
fa2de5413d Fix android test (#7862) 2023-05-27 14:58:52 +01:00
TangHuaiZhe
d7c3cedd67 Refine doc and comments about android test (#7694) 2023-02-14 10:26:50 +02:00
Yuri Schimke
223682e5e8 Leave default SNI on API 24+ (#7526) 2022-12-31 11:49:02 +10:00
Yuri Schimke
37c1001453 Fix android tests (#7464) 2022-09-24 17:28:22 +01:00
Yuri Schimke
68c36fd5b6 Fix android tests (#7374) 2022-07-16 12:36:06 +01:00
Yuri Schimke
fc77503303 Android module and Async Dns (#7157)
Adds an android module as an aar file.  The first functionality is an AsyncDns implementation for Android DnsResolver.
2022-03-20 06:48:45 +00:00
Yuri Schimke
d9b90e1b2c Fix a failing android test and cleanup (#7135) 2022-03-01 07:23:28 +00:00
Goooler
9d0208d43a Cleanup libs.versions.toml (#7082) 2022-02-17 19:03:07 +00:00
Yuri Schimke
362f53546d Adopt Version Catalog and Updates plugin (#7075) 2022-02-15 23:38:32 +00:00
Goooler
f5758b7f26 Enable Gradle's type-safe project accessors (#7069) 2022-02-08 20:01:28 +00:00
Yuri Schimke
91f45ce409 Fix android test (#7018) 2022-01-22 12:05:32 +00:00
Yuri Schimke
65a8c86b17 Fix module name after kts switch (#6934) 2021-11-27 17:14:19 +00:00
Jesse Wilson
d9a65a85c5 Switch to Vanniktech for Maven publishing (#6929)
* Switch to Vanniktech for Maven publishing

Steal configuration from Okio, which already works nicely.

* Update mockwebserver-junit5/build.gradle.kts

Co-authored-by: Benoît Quenaudon <bquenaudon@squareup.com>

Co-authored-by: Benoît Quenaudon <bquenaudon@squareup.com>
2021-11-26 06:58:00 -05:00
Yuri Schimke
c1a6dec505 Allow Custom SSLSocketFactory without ALPN support (#6862)
* Allow Custom SSLSocketFactory without ALPN support

* Allow Custom SSLSocketFactory without ALPN support

* Revert reformatting

* Reuse delegate classes
2021-11-23 20:29:18 -05:00
Goooler
f037cf7d13 Convert android modules' gradle to kts (#6797) 2021-07-30 23:11:14 +03:00
Goooler
c729ac28ef Optimize dependencies in android modules (#6793) 2021-07-30 11:38:36 +03:00
Goooler
6720813ede Bump AGP to 7.0.0 and Java 11 target (#6788) 2021-07-29 18:58:03 +03:00
Yuri Schimke
b5117a5c10 Android dependency upgrade (#6755) 2021-07-25 13:54:13 +03:00
Yuri Schimke
be518bc3eb Fix DoH tests for android (#6751) 2021-07-12 08:44:35 +01:00
Yuri Schimke
e53809767a Kotlin 1.5.0 (#6664) 2021-06-14 08:34:15 +10:00
Yuri Schimke
ffeffc669c Simplify gradle modules to avoid Intellij weirdness (#6615) 2021-04-24 18:27:11 +01:00
Yuri Schimke
ab34c10aca Fix versions typo in gradle build files (#6578)
* Fix versions typo in build script

* Fix versions string
2021-03-30 21:28:47 -04:00