hey, I want to intercept all the request to check ...
# ktor
k
hey, I want to intercept all the request to check if the request header has
uid
field, so this is my code
Copy code
intercept(ApplicationCallPipeline.Call) {
        call.request.headers["uid"] ?: throw BadRequestException("no uid field in the request header")
    }
but I want to allow the request uri ending with "/image/download/*" to pass all the intercept, how can I write it ?
a
You add the following condition on the first line of the interceptor:
Copy code
if (call.request.uri.startsWith("/image/download/")) return@onCall