lib/httpserver: add new X-Server-Hostname header instead of overwriting already exsiting header

This makes possible tracking origins of chained requests over multiple hops.
This commit is contained in:
Aliaksandr Valialkin 2021-05-11 23:47:16 +03:00
parent f1317f7c6c
commit 1d32b008c6

View File

@ -217,7 +217,7 @@ func handlerWrapper(s *server, w http.ResponseWriter, r *http.Request, rh Reques
}
}()
w.Header().Set("X-Server-Hostname", hostname)
w.Header().Add("X-Server-Hostname", hostname)
requestsTotal.Inc()
if whetherToCloseConn(r) {
connTimeoutClosedConns.Inc()