A Clever, Flawed OkHttp Interceptor Hack

1 · Jesse Wilson · April 2, 2017, 3:37 p.m.
All of OkHttp’s configuration is on the OkHttpClient instance: OkHttpClient client = new OkHttpClient.Builder() .readTimeout(2_000, TimeUnit.MILLISECONDS) .writeTimeout(2_000, TimeUnit.MILLISECONDS) .cache(new Cache(cacheDirectory, cacheSize)) .build(); This design is minimal and simple. There aren’t any precedence rules or hidden settings to be surprised by....