mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
cmd/containerboot: preserve headers of metrics endpoints responses (#14204)
Updates tailscale/tailscale#11292 Signed-off-by: Irbe Krumina <irbe@tailscale.com>
This commit is contained in:
parent
f6431185b0
commit
ba3523fc3f
@ -38,12 +38,12 @@ func proxy(w http.ResponseWriter, r *http.Request, url string, do func(*http.Req
|
|||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
w.WriteHeader(resp.StatusCode)
|
|
||||||
for key, val := range resp.Header {
|
for key, val := range resp.Header {
|
||||||
for _, v := range val {
|
for _, v := range val {
|
||||||
w.Header().Add(key, v)
|
w.Header().Add(key, v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
w.WriteHeader(resp.StatusCode)
|
||||||
if _, err := io.Copy(w, resp.Body); err != nil {
|
if _, err := io.Copy(w, resp.Body); err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user