diff options
| -rw-r--r-- | roseh.moe.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/roseh.moe.go b/roseh.moe.go index 32bcb6c..d28b1a5 100644 --- a/roseh.moe.go +++ b/roseh.moe.go @@ -28,6 +28,7 @@ import ( "net/http/httputil" "net/url" "os" + "path" "path/filepath" "slices" "strconv" @@ -264,7 +265,7 @@ func serveStaticFile(w http.ResponseWriter, r *http.Request, path string) { } func static(w http.ResponseWriter, r *http.Request) { - serveStaticFile(w, r, strings.TrimPrefix(r.URL.Path, "/")) + serveStaticFile(w, r, path.Clean(strings.TrimPrefix(r.URL.Path, "/"))) } func favicon(w http.ResponseWriter, r *http.Request) { |
