mitchellh / go-server-timing

Go (golang) library for creating and consuming HTTP Server-Timing headers
https://gist.github.com/mitchellh/90029601268e59a29e64e55bab1c5bdc
MIT License
862 stars 38 forks source link

Support for trailers #23

Open mitar opened 2 years ago

mitar commented 2 years ago

It seems Firefox supports them now (at least over HTTP2) and Chrome had support for them, but they have currently a regression: https://bugs.chromium.org/p/chromium/issues/detail?id=1280260

Maybe it is time to add support for trailers, too. So that we can add total handler time finally.

mitar commented 2 years ago

OK, I figured out that it is easy to do it myself. I just issue an additional Server-Timing trailer header after request was handled (and set w.Header().Set("Trailer", "Server-Timing") before).