]> source.dussan.org Git - gitea.git/commit
Pass down SignedUserName down to AccessLogger context (#16605)
authorzeripath <art27@cantab.net>
Wed, 4 Aug 2021 17:26:30 +0000 (18:26 +0100)
committerGitHub <noreply@github.com>
Wed, 4 Aug 2021 17:26:30 +0000 (13:26 -0400)
commit7c4172ef71a0805f16b8bd89188bb1b4d3e33f9b
tree4daee35e7dee3393d457ccf1e3ade708fe65dde7
parentf03abe8fb1919eed9c5a923f4f2c438a5fca351a
Pass down SignedUserName down to AccessLogger context (#16605)

* Pass down SignedUserName down to AccessLogger context

Unfortunately when the AccessLogger was moved back before the contexters the
SignedUserName reporting was lost. This is due to Request.WithContext leading to a
shallow copy of the Request and the modules/context/Context being within that request.

This PR adds a new context variable of a string pointer which is set and handled
in the contexters.

Fix #16600

Signed-off-by: Andrew Thornton <art27@cantab.net>
* handle nil ptr issue

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
modules/context/access_log.go
modules/context/api.go
modules/context/context.go