From 3e8a08609d336003c1f0a156c4a4e93a76eeef20 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Mon, 7 Jul 2025 17:01:32 +0100 Subject: [PATCH] pluginshared: Cleanup request path in tests (#37299) --- internal/pluginshared/testing.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/pluginshared/testing.go b/internal/pluginshared/testing.go index 4dce7ffcba..6c06cf0f23 100644 --- a/internal/pluginshared/testing.go +++ b/internal/pluginshared/testing.go @@ -9,6 +9,7 @@ import ( "net/http" "net/http/httptest" "os" + "path/filepath" "testing" "time" ) @@ -67,7 +68,8 @@ func (h *testHTTPHandler) Handle(w http.ResponseWriter, r *http.Request) { w.Write([]byte(testManifest)) } default: - fileToSend, err := os.Open(fmt.Sprintf("testdata/%s", r.URL.Path)) + path := filepath.Clean(r.URL.Path) + fileToSend, err := os.Open(fmt.Sprintf("testdata/%s", path)) if err == nil { io.Copy(w, fileToSend) return