[arvados] created: 2.6.0-543-g33f0193ee7
git repository hosting
git at public.arvados.org
Fri Sep 1 14:02:03 UTC 2023
at 33f0193ee7e0c7660413077c86304ecd30c080b3 (commit)
commit 33f0193ee7e0c7660413077c86304ecd30c080b3
Author: Tom Clegg <tom at curii.com>
Date: Wed Aug 30 14:30:27 2023 -0400
github-207: Fix outgoing Host header in proxy request.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/controller/handler.go b/lib/controller/handler.go
index 08a3a1a93d..7c4bb0912f 100644
--- a/lib/controller/handler.go
+++ b/lib/controller/handler.go
@@ -205,6 +205,11 @@ func (h *Handler) localClusterRequest(req *http.Request) (*http.Response, error)
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)
}
@@ -279,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()
- // 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.
- req, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://localhost" + path, nil)
+ req, err := http.NewRequestWithContext(ctx, http.MethodGet, "http://localhost", nil)
if err != nil {
return nil, nil, err
}
+ req.URL.Path = path
resp, err := do(req)
if err != nil {
return nil, nil, err
commit 64381eec0141c807f4b15093042450e2f680c46d
Author: George Chlipala <gchlip2 at uic.edu>
Date: Mon Aug 28 16:57:06 2023 -0500
Fix for cached files from arvados-controller
Arvados-DCO-1.1-Signed-off-by: George Chlipala <gchlip2 at uic.edu>
diff --git a/AUTHORS b/AUTHORS
index fa9fa86d34..cb09dc67ae 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -22,3 +22,4 @@ Curii Corporation <*@curii.com>
Dante Tsang <dante at dantetsang.com>
Codex Genetics Ltd <info at codexgenetics.com>
Bruno P. Kinoshita <brunodepaulak at yahoo.com.br>
+George Chlipala <gchlip2 at uic.edu>
diff --git a/lib/controller/handler.go b/lib/controller/handler.go
index bfcb98b9d9..08a3a1a93d 100644
--- a/lib/controller/handler.go
+++ b/lib/controller/handler.go
@@ -282,7 +282,7 @@ func (ent *cacheEnt) refresh(path string, do func(*http.Request) (*http.Response
// 0.0.0.0:0 is just a placeholder here -- do(), which is
// 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" + path, nil)
if err != nil {
return nil, nil, err
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list