HTTP.jl
HTTP.jl copied to clipboard
How to log size of incoming request?
- Julia 1.7.3
- HTTP.jl 1
The logging function supplied with HTTP.jl checks the stream.nwritten field to log the size of the data sent out.
https://github.com/JuliaWeb/HTTP.jl/blob/master/src/Streams.jl#L16
But I would like to also log what the size of the data coming in was. At the time when the logging function is called, the other field ntoread is always 0, which points to it being a state variable that is 0 once the whole incoming message has been read.
How would I correctly get the size of the received message? I've considered looking at stream.message.body but I'm not sure if that's the way to go.
You can perhaps log the incoming ContentLength header for now.
I will have a look at that, thank you.