Commit f3a183ec authored by Abiola Ibrahim's avatar Abiola Ibrahim

Use filepath.Clean for fileserver.

parent 741d7685
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"net/http" "net/http"
"os" "os"
"path" "path"
"path/filepath"
"strings" "strings"
) )
...@@ -43,7 +44,7 @@ func (fh *fileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, e ...@@ -43,7 +44,7 @@ func (fh *fileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, e
upath = "/" + upath upath = "/" + upath
r.URL.Path = upath r.URL.Path = upath
} }
return fh.serveFile(w, r, path.Clean(upath)) return fh.serveFile(w, r, filepath.Clean(upath))
} }
// serveFile writes the specified file to the HTTP response. // serveFile writes the specified file to the HTTP response.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment