i would like to implement a middelware proxy. Where all calls gets forwarded with an added header. This is what tried.
intercept(ApplicationCallPipeline.Call) {
val targetUrl = BASE_URL + call.request.uri
val response = client.request(targetUrl) {
headers {
append(HttpHeaders.Authorization, "Bearer $API_KEY")
}
}
call.respond(response)
}