pluginshared: Cleanup request path in tests (#37299)

pull/37287/head^2
Radek Simko 10 months ago committed by GitHub
parent 6740c5e3d1
commit 3e8a08609d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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

Loading…
Cancel
Save