-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache URL Override #8234
Cache URL Override #8234
Conversation
okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt
Show resolved
Hide resolved
okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great feature. Very small impact on the public API, very big impact on what people can do with OkHttp.
okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt
Show resolved
Hide resolved
okhttp-dnsoverhttps/src/test/java/okhttp3/dnsoverhttps/DnsOverHttpsTest.kt
Show resolved
Hide resolved
var recordedRequest = server.takeRequest() | ||
assertThat(recordedRequest.method).isEqualTo("POST") | ||
assertThat(recordedRequest.path) | ||
.isEqualTo("/lookup?ct") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off-topic: we’re naughty for having a field called path
that contains a path and a query. Thanks for confirming that we use the right URL for these!
@@ -1048,6 +1049,7 @@ public class okhttp3/Request$Builder { | |||
public fun addHeader (Ljava/lang/String;Ljava/lang/String;)Lokhttp3/Request$Builder; | |||
public fun build ()Lokhttp3/Request; | |||
public fun cacheControl (Lokhttp3/CacheControl;)Lokhttp3/Request$Builder; | |||
public final fun cacheUrlOverride (Lokhttp3/HttpUrl;)Lokhttp3/Request$Builder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that we’re not adding OkHttpExperimentalApi
on this, and so we’re committing to this exact API and name. I’m okay with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we reconsider as a policy for new API?
Co-authored-by: Jesse Wilson <[email protected]>
Co-authored-by: Jesse Wilson <[email protected]>
Co-authored-by: Jesse Wilson <[email protected]>
Co-authored-by: Jesse Wilson <[email protected]>
A minimal change to allow a cacheUrlOverride on request for the following examples
It is implemented almost entirely within CacheInterceptor, mutating the request/response that Cache sees to avoid a broader change such as supporting POSTs.
Addresses #8211 also #8113