GZip compression for networking
parent
f3181cc0f1
commit
3963099053
@ -0,0 +1,14 @@
|
|||||||
|
package org.koitharu.kotatsu.core.network
|
||||||
|
|
||||||
|
import okhttp3.Interceptor
|
||||||
|
import okhttp3.Response
|
||||||
|
import org.jsoup.helper.HttpConnection.CONTENT_ENCODING
|
||||||
|
|
||||||
|
class GZipInterceptor : Interceptor {
|
||||||
|
|
||||||
|
override fun intercept(chain: Interceptor.Chain): Response {
|
||||||
|
val newRequest = chain.request().newBuilder()
|
||||||
|
newRequest.addHeader(CONTENT_ENCODING, "gzip")
|
||||||
|
return chain.proceed(newRequest.build())
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue