projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '21031-test-provision-fix'. Refs #21031
[arvados.git]
/
lib
/
controller
/
handler.go
diff --git
a/lib/controller/handler.go
b/lib/controller/handler.go
index 7b7378ac55200888bbff205341a72bc73cbc9597..7c4bb0912fb3feae8871d9a5e2f920bb777738c4 100644
(file)
--- a/
lib/controller/handler.go
+++ b/
lib/controller/handler.go
@@
-140,6
+140,8
@@
func (h *Handler) setup() {
mux.Handle("/arvados/v1/groups/", rtr)
mux.Handle("/arvados/v1/links", rtr)
mux.Handle("/arvados/v1/links/", rtr)
mux.Handle("/arvados/v1/groups/", rtr)
mux.Handle("/arvados/v1/links", rtr)
mux.Handle("/arvados/v1/links/", rtr)
+ mux.Handle("/arvados/v1/authorized_keys", rtr)
+ mux.Handle("/arvados/v1/authorized_keys/", rtr)
mux.Handle("/login", rtr)
mux.Handle("/logout", rtr)
mux.Handle("/arvados/v1/api_client_authorizations", rtr)
mux.Handle("/login", rtr)
mux.Handle("/logout", rtr)
mux.Handle("/arvados/v1/api_client_authorizations", rtr)
@@
-203,6
+205,11
@@
func (h *Handler) localClusterRequest(req *http.Request) (*http.Response, error)
if insecure {
client = h.insecureClient
}
if insecure {
client = h.insecureClient
}
+ // Clearing the Host field here causes the Go http client to
+ // use the host part of urlOut as the Host header in the
+ // outgoing request, instead of the Host value from the
+ // original request we received.
+ req.Host = ""
return h.proxy.Do(req, urlOut, client)
}
return h.proxy.Do(req, urlOut, client)
}
@@
-277,13
+284,15
@@
func (ent *cacheEnt) refresh(path string, do func(*http.Request) (*http.Response
ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Minute))
defer cancel()
ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(time.Minute))
defer cancel()
- // 0.0.0.0:0 is just a placeholder here -- do(), which is
+ // "http://localhost" is just a placeholder here -- we'll fill
+ // in req.URL.Path below, and then do(), which is
// localClusterRequest(), will replace the scheme and host
// parts with the real proxy destination.
// localClusterRequest(), will replace the scheme and host
// parts with the real proxy destination.
- req, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://
0.0.0.0:0/"+path
, nil)
+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://
localhost"
, nil)
if err != nil {
return nil, nil, err
}
if err != nil {
return nil, nil, err
}
+ req.URL.Path = path
resp, err := do(req)
if err != nil {
return nil, nil, err
resp, err := do(req)
if err != nil {
return nil, nil, err