From 386847ac376aafab0103d653388ed944a4479df5 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Fri, 8 Oct 2021 14:10:18 +0200 Subject: [PATCH] use TrimPrefix instead of TrimLeft --- graph/pkg/service/v0/drives.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graph/pkg/service/v0/drives.go b/graph/pkg/service/v0/drives.go index fcd790a81..2cd8f8b95 100644 --- a/graph/pkg/service/v0/drives.go +++ b/graph/pkg/service/v0/drives.go @@ -218,7 +218,7 @@ func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request) { // strip "/graph/v1.0/" out and parse the rest. This is how godata input is expected. //https://github.com/CiscoM31/godata/blob/d70e191d2908191623be84401fecc40d6af4afde/url_parser_test.go#L10 - sanitized := strings.TrimLeft(r.URL.Path, "/graph/v1.0/") + sanitized := strings.TrimPrefix(r.URL.Path, "/graph/v1.0/") req, err := godata.ParseRequest(sanitized, r.URL.Query(), true) if err != nil {