Change filepaths to use filepath.Join() where possible

This commit is contained in:
2025-01-19 20:07:32 +01:00
parent 6885dfbb38
commit 9feb16a8d8
7 changed files with 26 additions and 26 deletions

View File

@ -5,6 +5,7 @@ import (
"log"
"net/http"
"os"
"path/filepath"
b "streifling.com/jason/cpolis/cmd/backend"
)
@ -42,6 +43,6 @@ func ServePDF(c *b.Config) http.HandlerFunc {
return
}
http.ServeFile(w, r, c.PDFDir+"/"+r.PathValue("id"))
http.ServeFile(w, r, filepath.Join(c.PDFDir, r.PathValue("id")))
}
}