From d2cccfe91ec24c76eb4e5de60a6e6372207d9b4e Mon Sep 17 00:00:00 2001 From: Malcolm Holmes Date: Tue, 7 Dec 2021 15:04:55 +0000 Subject: [PATCH] lint --- pkg/api/plugins.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/api/plugins.go b/pkg/api/plugins.go index b62ea85fac5..9612551fe01 100644 --- a/pkg/api/plugins.go +++ b/pkg/api/plugins.go @@ -265,7 +265,7 @@ func (hs *HTTPServer) getPluginAssets(c *models.ReqContext) { } // prepend slash for cleaning relative paths - requestedFile := filepath.Clean(filepath.Join("/",macaron.Params(c.Req)["*"])) + requestedFile := filepath.Clean(filepath.Join("/", macaron.Params(c.Req)["*"])) rel, err := filepath.Rel("/", requestedFile) if err != nil { // slash is prepended above therefore this is not expected to fail @@ -283,7 +283,7 @@ func (hs *HTTPServer) getPluginAssets(c *models.ReqContext) { c.JsonApiErr(500, "Failed to get plugin absolute path", nil) return } - + pluginFilePath := filepath.Join(absPluginDir, rel) // It's safe to ignore gosec warning G304 since we already clean the requested file path and subsequently // use this with a prefix of the plugin's directory, which is set during plugin loading