projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '13823-bionic'
[arvados.git]
/
lib
/
controller
/
proxy.go
diff --git
a/lib/controller/proxy.go
b/lib/controller/proxy.go
index 7905f91d0575e70cd5348ce0eafcf2c57f6f5490..712071bef947bf02782427d4a739f3e74ee26c4c 100644
(file)
--- a/
lib/controller/proxy.go
+++ b/
lib/controller/proxy.go
@@
-46,6
+46,9
@@
func (p *proxy) Do(w http.ResponseWriter, reqIn *http.Request, urlOut *url.URL,
xff = xffIn + "," + xff
}
hdrOut.Set("X-Forwarded-For", xff)
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()
hdrOut.Add("Via", reqIn.Proto+" arvados-controller")
ctx := reqIn.Context()
@@
-58,12
+61,13
@@
func (p *proxy) Do(w http.ResponseWriter, reqIn *http.Request, urlOut *url.URL,
reqOut := (&http.Request{
Method: reqIn.Method,
URL: urlOut,
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 {
Header: hdrOut,
Body: reqIn.Body,
}).WithContext(ctx)
resp, err := client.Do(reqOut)
if err != nil {
- httpserver.Error(w, err.Error(), http.Status
InternalServerError
)
+ httpserver.Error(w, err.Error(), http.Status
BadGateway
)
return
}
for k, v := range resp.Header {
return
}
for k, v := range resp.Header {