package com.zxhl.cms.net.callback

import okhttp3.Interceptor
import okhttp3.Response
import java.io.IOException

class DownloadInterceptor : Interceptor {

    @Throws(IOException::class)
    override fun intercept(chain: Interceptor.Chain): Response {
        val originalResponse = chain.proceed(chain.request())
        return originalResponse.newBuilder()
                .body(DownloadResponseBody(originalResponse.body!!))
                .build()

    }

}