dieyi

Results 2 issues of dieyi

简单粗略的扫了一下,其他的没看,简单的看了 OkHttp 的部分。 说实话 OkHttp 的拦截**非常有问题** ## OkHttp3Aspect 在 OkHttpClient.Builder.build() 的时候添加一个 NetWorkInterceptor 拦截器,作为最外层的普通拦截器,忽略了内部的网络请求自动重定向/重试等多个 Http请求,且拿到的 Response 是转换后的(如自动解 Gzip)统计的结果自然不准确。 而且,这里添加的拦截器,会被 OkHttpClient.interceptors()方法暴露出去。如果有其他逻辑依赖这个方法,就会有问题。 其次,如果是 OkHttpClient.newBuilder(),那么在下次 build 时会有重复的多个拦截器,统计结果能准确吗。 个人认为最佳实践是在 RealCall.getResponseWithInterceptorChain方法内,调用 OkHttpClient.interceptors() 与 networkInterceptor() 时添加对应的拦截器。事实上如果要更多细节的数据,如 DNS...

Because of ELEME organization is deprecated, I create another repo for Lancet: [https://github.com/CoffeePartner/Lancet](https://github.com/CoffeePartner/Lancet). I will continue to maintain Lancet at a long term. Recently, I start to rewrite almost all...