Hey folks, I'm writing a feature and I have two in...
# ktor
v
Hey folks, I'm writing a feature and I have two intercept phases, one before request is processed and other after response is written, I'm using
pipeline.insertPhaseBefore(ApplicationCallPipeline.Monitoring, phase)
and
pipeline.sendPipeline.insertPhaseAfter(ApplicationSendPipeline.After, postSendPhase)
specifically. Now, when I access the
ApplicationCall
request
and
response
is there a way to find the content-length of each? Sorry but it was not clear via the base classes how one would access that information. Thank you
c
You don't need to intercept both, just intercept single and proceed inside of try/finally
You need to look at request and response headers to get length. You also may need to intercept response pipeline, not just call pipeline.
v
Thanks, that is indeed much simpler, and got the response size via the headers