caddy
caddy copied to clipboard
caddyhttp: Export `LengthReader`
Closes #5728
Exporting it allows other modules to look at the length at any point in time, which may be useful if they hijack the connection.
Exporting this type isn't enough for hijacked connections to see how many bytes are read. As this body is actually http.NoBody for GET request which are usually the hijackable requests.
Also, even if the body is readable (no eof), it has nothing to do with the bytes counting, as the body reads from the connection while Hijack returns the underlying connection.
/cc @Mygod :point_up:
I'm not sure I can finish this off, I'll leave it to @Mygod who requested it to make the necessary adjustments.