Add editor interface
This commit is contained in:
3
main.go
3
main.go
@@ -86,7 +86,8 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
urlPath := path.Clean("/" + r.URL.Path)
|
||||
fsPath := filepath.Join(h.root, filepath.FromSlash(urlPath))
|
||||
|
||||
fsPath := filepath.Join(h.root, filepath.FromSlash(urlPath))
|
||||
|
||||
// Security: ensure the resolved path stays within root.
|
||||
rel, err := filepath.Rel(h.root, fsPath)
|
||||
|
||||
Reference in New Issue
Block a user