go-chi / go-chi/httplog

add tracking of request body reads

Open
#64 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
319
Forks
45
Avg merge
3d 16h
Merged PRs (30d)
6

Description

Currently, [RequestBytes](https://github.com/go-chi/httplog/blob/master/middleware.go#L132) is logged, however it's based solely on `ContentLength`. This leads to potential inaccuracies if `ContentLength` header isn't present. Additionally, it doesn't track actual bytes read.

Would like to see logging attributes include the actual bytes read, possibly following an approach similar to [Caddy](https://github.com/caddyserver/caddy/blob/3b4d966fba069e9895980dbbf05f84bf818968ba/modules/caddyhttp/server.go#L343).

Happy to submit a PR if there is an appetite to add this.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.