xff = xffIn + "," + xff
}
hdrOut.Set("X-Forwarded-For", xff)
+ if hdrOut.Get("X-Forwarded-Proto") == "" {
+ hdrOut.Set("X-Forwarded-Proto", reqIn.URL.Scheme)
+ }
hdrOut.Add("Via", reqIn.Proto+" arvados-controller")
ctx := reqIn.Context()
reqOut := (&http.Request{
Method: reqIn.Method,
URL: urlOut,
+ Host: reqIn.Host,
Header: hdrOut,
Body: reqIn.Body,
}).WithContext(ctx)
resp, err := client.Do(reqOut)
if err != nil {
- httpserver.Error(w, err.Error(), http.StatusInternalServerError)
+ httpserver.Error(w, err.Error(), http.StatusBadGateway)
return
}
for k, v := range resp.Header {