Untitled
unknown
plain_text
a year ago
863 B
19
Indexable
class AuthenticationInterceptor(private val authToken: String) : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val original: Request = chain.request()
val request: Request = original.newBuilder()
.header("Authorization", authToken)
.header("X-APP-VERSION", ServiceGenerator.VERSION_NAME)
.header("X-APP-ID", ServiceGenerator.APPLICATION_ID)
.build()
return try {
chain.proceed(request)
} catch (e: Throwable) {
return Response.Builder()
.request(original)
.protocol(Protocol.HTTP_1_1)
.code(400)
.message("test_23072024____" + e.message)
.body("test_23072024__".toResponseBody(null))
.build()
}
}
}Editor is loading...
Leave a Comment