go-server-timing
go-server-timing copied to clipboard
How to merge timings with downstream timinngs
The code in https://github.com/mitchellh/go-server-timing/blob/master/middleware.go#L97 currently calls:
headers.Set(HeaderKey, h.String())
I am adding the timings to a http proxy and it would be good to not clober the downstream timing from the actual backend. This could probably be done by using Add instead of Set. Is there a reason for not merging the headers?
If I use the servertiming.MiddlewareOpts{DisableHeaders: true} on the proxy I see my backend timings. Otherwise the get overwritten.