From 3bd45e4560a6deb2073ad06a90615b0ee0e7574f Mon Sep 17 00:00:00 2001 From: Fedor Korotkov Date: Tue, 15 Oct 2024 14:03:00 -0400 Subject: [PATCH] Fixed http cache regression (#801) * Fixed cache path regression * Use wildcard --- internal/agent/http_cache/http_cache.go | 2 +- internal/agent/http_cache/http_cache_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/agent/http_cache/http_cache.go b/internal/agent/http_cache/http_cache.go index 75325df1..4ff17830 100644 --- a/internal/agent/http_cache/http_cache.go +++ b/internal/agent/http_cache/http_cache.go @@ -44,7 +44,7 @@ func Start(opts ...Option) string { mux := http.NewServeMux() // HTTP cache protocol - mux.HandleFunc("/{objectname}", handler) + mux.HandleFunc("/{objectname...}", handler) address := "127.0.0.1:12321" listener, err := net.Listen("tcp", address) diff --git a/internal/agent/http_cache/http_cache_test.go b/internal/agent/http_cache/http_cache_test.go index 7791ffad..94eff7d1 100644 --- a/internal/agent/http_cache/http_cache_test.go +++ b/internal/agent/http_cache/http_cache_test.go @@ -18,7 +18,7 @@ func TestHTTPCache(t *testing.T) { client.InitClient(cirruscimock.ClientConn(t), "test", "test") - httpCacheObjectURL := "http://" + http_cache.Start() + "/" + uuid.NewString() + httpCacheObjectURL := "http://" + http_cache.Start() + "/cache/" + uuid.NewString() + "/test.txt" // Ensure that the cache entry does not exist resp, err := http.Get(httpCacheObjectURL)