This commit is contained in:
Jan-Lukas Else 2021-01-10 15:45:47 +01:00
parent 8c73686a6f
commit b2c618f300
2 changed files with 2 additions and 3 deletions

View File

@ -3,7 +3,6 @@ package main
import (
"net/http"
"os"
"path"
"path/filepath"
"strings"
)
@ -29,5 +28,5 @@ func allStaticPaths() (paths []string) {
// Gets only called by registered paths
func serveStaticFile(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, path.Join(staticFolder, r.URL.Path))
http.ServeFile(w, r, filepath.Join(staticFolder, r.URL.Path))
}

View File

@ -90,5 +90,5 @@ func allAssetPaths() []string {
// Gets only called by registered paths
func serveAsset(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Cache-Control", "public,max-age=31536000,immutable")
http.ServeFile(w, r, path.Join(compiledAssetsFolder, r.URL.Path))
http.ServeFile(w, r, filepath.Join(compiledAssetsFolder, r.URL.Path))
}