weaveworks / common

Libraries used in multiple Weave projects
Other
129 stars 92 forks source link

Log middleware now accepts a list of headers to exclude #277

Closed jesusvazquez closed 1 year ago

jesusvazquez commented 1 year ago

Previously the log middleware would exclude printing only the headers "Cookie", "Authorization" and "X-Csrf-Token". I believe the users of this library may want to ommit more headers than those.

To do so I've changed how the middleware is initialize to optionally add more headers to the list.

Also I've added a unit test to make sure the behavior works as expected.

~Also I've added an optional configuration parameter to the server to set LogRequestHeaders from there. This parameter was already an option in the log middleware but was not exposed in the server.~ EDIT: this bit was removed.

Signed-off-by: Jesus Vazquez jesus.vazquez@grafana.com