mirror of
https://github.com/moby/buildkit.git
synced 2026-08-07 16:20:46 +00:00
client: remove use of deprecated proxy.Director (staticcheck)
client/build_test.go:2363:14: SA1019: proxy.Director has been deprecated since Go 1.26 and an alternative has been available since Go 1.20: Use Rewrite instead. (staticcheck) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -65,11 +65,11 @@ func testClientGatewayCanceledCredentialsCallbackReturns(t *testing.T, sb integr
|
||||
target, err := url.Parse("http://" + registry)
|
||||
require.NoError(t, err)
|
||||
|
||||
proxy := httputil.NewSingleHostReverseProxy(target)
|
||||
director := proxy.Director
|
||||
proxy.Director = func(req *http.Request) {
|
||||
director(req)
|
||||
req.Host = target.Host
|
||||
proxy := &httputil.ReverseProxy{
|
||||
Rewrite: func(pr *httputil.ProxyRequest) {
|
||||
pr.SetURL(target)
|
||||
pr.Out.Host = target.Host
|
||||
},
|
||||
}
|
||||
|
||||
proxyServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user