From 73bf1a31b0aaa308a72536a9ae646b40cbaa5f47 Mon Sep 17 00:00:00 2001 From: Adnan Maolood Date: Wed, 17 Feb 2021 00:57:44 -0500 Subject: [PATCH] fs: Clean paths before handling with FileServer --- fs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs.go b/fs.go index c3e0443..444ae3c 100644 --- a/fs.go +++ b/fs.go @@ -32,7 +32,7 @@ type fileServer struct { } func (fs fileServer) ServeGemini(w ResponseWriter, r *Request) { - ServeFile(w, fs, r.URL.Path) + ServeFile(w, fs, path.Clean(r.URL.Path)) } // ServeFile responds to the request with the contents of the named file