Plugins: Compose filesystem paths with filepath.Join (#28375)
* plugins: Fix filesystem path composition Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com> * plugins: Use filepath.Join to join filesystem paths Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
@@ -338,7 +337,7 @@ func (hs *HTTPServer) GetHomeDashboard(c *models.ReqContext) Response {
|
||||
|
||||
filePath := hs.Cfg.DefaultHomeDashboardPath
|
||||
if filePath == "" {
|
||||
filePath = path.Join(hs.Cfg.StaticRootPath, "dashboards/home.json")
|
||||
filePath = filepath.Join(hs.Cfg.StaticRootPath, "dashboards/home.json")
|
||||
}
|
||||
|
||||
file, err := os.Open(filePath)
|
||||
|
||||
Reference in New Issue
Block a user