Skip to content

Commit

Permalink
Merge pull request #33 from juliogonzalez/FIX/rrd-path-trailing-slash
Browse files Browse the repository at this point in the history
Allow RrdPaths without trailing slash
  • Loading branch information
Hayato Matsuura committed Feb 22, 2018
2 parents 0a90a3e + 4669f9a commit 491d46d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rrdserver.go
Expand Up @@ -171,7 +171,7 @@ func query(w http.ResponseWriter, r *http.Request) {
ds := target.Target[strings.LastIndex(target.Target, ":")+1 : len(target.Target)]
rrdDsRep := regexp.MustCompile(`:` + ds + `$`)
fileSearchPath := rrdDsRep.ReplaceAllString(target.Target, "")
fileSearchPath = config.Server.RrdPath + strings.Replace(fileSearchPath, ":", "/", -1) + ".rrd"
fileSearchPath = strings.TrimRight(config.Server.RrdPath, "/") + "/" + strings.Replace(fileSearchPath, ":", "/", -1) + ".rrd"

fileNameArray, _ := zglob.Glob(fileSearchPath)
for _, filePath := range fileNameArray {
Expand Down

0 comments on commit 491d46d

Please sign in to comment.