1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-14 07:22:20 +03:00
Commit Graph

42 Commits

Author SHA1 Message Date
Yuri Schimke
86b7ba5f2a Enable BouncyCastle on Android and add some testing (#5936) 2020-04-11 17:35:27 +01:00
Yuri Schimke
19771365f2 Rename to src/main/kotlin (#5938)
Follows the default path logic for kotlin classes.
2020-04-11 17:15:25 +01:00
Jesse Wilson
ca0c8d6a1a Prepare for release 4.5.0. 2020-04-06 10:54:10 -04:00
Yuri Schimke
46fcf4f42c Fix for infinite caching in DoH (#5918)
Hit the cache only initially, but avoid using stale cached data.
2020-04-02 12:58:26 +01:00
Jesse Wilson
c1d50e371f Upgrade Okio and some build dependencies
The new ktlint sorts imports which makes this diff large.

The new japicmp ignores 'final' modifier changes in final classes.

We adopt the Google style for checkstyle.xml.

Okio readByteString() now uses segments more aggressively, so we
need to mitigate that to avoid tracking those segments in a test.
2020-01-11 22:24:12 -05:00
Yuri Schimke
16173e2af9 Make Platform.log exception parameter optional (#5482)
Make Platform.log exception parameters optional, and reorders to allow level defaulting to INFO.
2019-09-29 16:59:58 +10:00
Yuri Schimke
6903b89e0b Cleanup of error prone and warnings (#5268)
* Comment some warnings

* Wrap

* Disable warnings
2019-07-15 21:11:35 -04:00
Jesse Wilson
22a420b3a2 Remove the Kotlin migration bridges from DnsOverHttps (#5157)
We promise no API stability in this package.
2019-06-02 07:19:16 +01:00
Jesse Wilson
12eb1c10c8 Merge pull request #5123 from square/idiomatic-kotlin-dnsoverhttps
Idiomatic Kotlin in DnsOverHttps.kt
2019-05-27 20:33:53 -04:00
Jesse Wilson
53ba4dd9ef Replace MediaType.get(string) with string.toMediaType() (#5132) 2019-05-27 06:38:35 +01:00
Masaru Nomura
f0a580070e Idiomatic Kotlin in DnsOverHttps.kt
- define the following vals in constructor instead of passing `builder: Builder`.
  - `@get:JvmName(...)` val
    - `client: OkHttpClient`
    - `url: HttpUrl`
    - `includeIPv6: Boolean`
    - `post: Boolean`
    - `resolvePrivateAddresses: Boolean`
    - `resolvePublicAddresses: Boolean`
  - `private` val
    - `systemDns: Dns`
    - `bootstrapDnsHosts: List<InetAddress>?`

- add `@Deprecated(...)` to the following functions.
  - `fun client(): OkHttpClient`
  - `fun url(): HttpUrl`
  - `fun includeIPv6(): Boolean`
  - `fun post(): Boolean`
  - `fun resolvePrivateAddresses(): Boolean`
  - `fun resolvePublicAddresses(): Boolean`
2019-05-26 16:28:07 -04:00
Jesse Wilson
8bb58332db Extension Functions toRequestBody(), toResponseBody() 2019-05-25 14:02:55 -04:00
Jesse Wilson
9c20f17270 Use vals in OkHttpClient 2019-05-25 10:34:25 -04:00
Jesse Wilson
8e96075fcd Merge pull request #5116 from TangHuaiZhe/dev
Replace !isEmpty with isNotEmpty
2019-05-25 09:49:25 -04:00
Jesse Wilson
f87bb6d817 Reorder the members of OkHttpClient (#5114)
This isn't perfect but I think it's a bit more logical.
2019-05-25 06:50:37 +01:00
Tang HuaiZhe
376b9a4e59 Replace !isEmpty with isNotEmpty 2019-05-25 12:00:05 +08:00
Masaru Nomura
7ad4f970ba Idiomatic Kotlin for Response.kt
- define `@get:JvmName(...)` for the following vals in constructor instead of passing `builder: Builder`.
  - `request: Request`
  - `protocol: Protocol`
  - `message: String`
  - `code: Int`
  - `handshake: Handshake?`
  - `headers: Headers`
  - `body: ResponseBody?`
  - `networkResponse: Response?`
  - `cacheResponse: Response?`
  - `priorResponse: Response?`
  - `sentRequestAtMillis: Long`
  - `receivedResponseAtMillis: Long`
  - `exchange: Exchange?`

- add `@Deprecated(...)` to the following functions.
  - `fun request(): Request`
  - `fun protocol(): Protocol`
  - `fun message(): String`
  - `fun code(): Int`
  - `fun handshake(): Handshake?`
  - `fun headers(): Headers`
  - `fun body(): ResponseBody?`
  - `fun networkResponse(): Response?`
  - `fun cacheResponse(): Response?`
  - `fun priorResponse(): Response?`
  - `fun sentRequestAtMillis(): Long`
  - `fun receivedResponseAtMillis(): Long`
  - `fun cacheControl(): CacheControl`

- clean up code where `()`(parentheses) is unnecessarily used.
2019-05-24 16:16:29 -04:00
Jesse Wilson
030dbeae26 Delete unwanted whitespace.
I think the convert-to-Kotlin feature adds these
2019-05-22 21:12:55 -04:00
Jesse Wilson
e67ec3c51e Adopt HttpUrl's new Kotlin API 2019-05-20 21:01:04 -04:00
Jesse Wilson
0b89e0ee59 Use apply {} in builders 2019-05-20 19:55:47 -04:00
Jesse Wilson
2c59337e31 Use check/require instead of if/throw 2019-05-20 19:02:41 -04:00
Jesse Wilson
2e0dfa29d0 Don't use @JvmStatic for internal calls 2019-05-20 16:00:40 -04:00
Yuri Schimke
dcf5c8ceb6 Fix/Simplify regex usage (#5059)
* Fix/Simplify regex usage

* Cleanup
2019-05-18 06:33:34 -04:00
Yuri Schimke
f3949c23bc Spotless code formatter 2019-04-10 22:44:58 +01:00
Tang HuaiZhe
58afc0bc56 Delete unused imports 2019-04-06 11:54:42 +08:00
Jesse Wilson
e458bd0a90 Configure Dokka 2019-03-30 17:28:37 -04:00
Yuri Schimke
e2cfcb35ea Okio upgrade post kotlin (#4814)
Okio 2.2.2 upgrade and adopt kotlin friendly API
2019-03-29 21:54:10 +00:00
Jesse Wilson
77fcbf3d99 Convert CertificatePinner to Kotlin (#4801) 2019-03-27 13:28:18 -05:00
Yuri Schimke
c2fa8ca193 Refactor DOH classes to Kotlin (#4768) 2019-03-24 12:24:40 +00:00
Jake Wharton
1764fe622b Use Throwable.addSuppressed directly
This is available with the new minimum requirements.
2019-03-21 20:35:10 -04:00
Jesse Wilson
dedc6ecd5b Use more AssertJ features 2019-03-14 17:57:42 -04:00
Benoît Quenaudon
6c4855a7c7 Use AssertJ in tests (#4713) 2019-03-13 21:07:33 -04:00
Yuri Schimke
ceb42f1322 EverythingIsNonNull annotation (#4286)
Adds an annotation EverythingIsNonNull, and fixes some nullability on public API.
2018-09-30 09:33:42 +01:00
Yuri Schimke
0b2486f7f3 Make separate IPv4 and IPv6 requests for DNS over HTTPS (#4234)
Make separate requests because DNS in practice does not support multiple questions A + AAAA in a single message.
2018-09-02 19:27:32 +01:00
Yuri Schimke
6cf1f1e75d Enable chantra for DNS over HTTPS testing 2018-08-23 07:45:42 +01:00
Yuri Schimke
d562795f7d DNS over HTTPS spec 13 2018-08-16 17:33:46 +01:00
Jesse Wilson
44c2696932 Merge pull request #4124 from square/jwilson.0706.client_certs
Support client authentication in MockWebServer
2018-07-06 16:22:42 -04:00
Jake Wharton
351b3d6bf7 Add get(String) alternative which fails on invalid inputs
This is an unchecked-throwing version of parse(String).
2018-07-06 15:30:55 -04:00
Jesse Wilson
d908a676c2 Support client authentication in MockWebServer
Also expose the handshake in the RecordedResponse.

https://github.com/square/okhttp/issues/3934
2018-07-06 10:08:19 -04:00
Jake Wharton
36f4fd04f7 Add parse overload which fails on invalid inputs 2018-07-05 23:18:15 -04:00
Yuri Schimke
aa58436fbf Update cloudflare GET example (#4097)
* Update cloudflare GET example

* add IP example
2018-06-28 22:38:47 -04:00
Yuri Schimke
5b37cda9e0 DNS over HTTPS (#3972)
DNS over HTTPS implementation

experimental API in 3.11
https://tools.ietf.org/html/draft-ietf-doh-dns-over-https-11
2018-06-24 20:29:21 +01:00