zeripath daf14b275a Ensure responses are context.ResponseWriters (#19843) (#19859)
* Ensure responses are context.ResponseWriters (#19843)

Backport #19843

In order for web.Wrap to be able to detect if a response has been written
we need to wrap any non-context.ResponseWriters as a such. Otherwise
responses will be incorrectly detected as non-written to and handlers can
double run.

In the case of GZip this handler will change the response to a non-context.RW
and this failure to correctly detect response writing causes fallthrough and
a NPE.

Fix #19839

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix test

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2022-06-03 17:38:29 -04:00
..
2022-01-10 17:32:37 +08:00
2021-12-20 04:41:31 +00:00
2021-12-06 00:24:57 +08:00
2022-01-10 17:32:37 +08:00
2022-01-14 16:03:31 +01:00
2020-10-02 23:37:53 -04:00
2021-12-20 04:41:31 +00:00
2022-01-02 21:12:35 +08:00
2022-01-10 17:32:37 +08:00
2022-01-10 17:32:37 +08:00
2021-12-20 04:41:31 +00:00
2022-01-02 21:12:35 +08:00
2022-01-10 17:32:37 +08:00
2021-12-20 04:41:31 +00:00
2020-04-05 07:20:50 +01:00
2021-10-13 22:50:23 -04:00