diff --git a/server/notes.go b/server/notes.go index 9dfa676..b0b811f 100644 --- a/server/notes.go +++ b/server/notes.go @@ -6,7 +6,7 @@ import ( ) func (s *Server) notes(w http.ResponseWriter, r *http.Request) { - p := NewPath(r.URL.Path) + p := NewPathFromURL(r.URL.Path) if p.IsDir() { head(w, r) notesHead(w, p) diff --git a/server/path.go b/server/path.go index 2e50edf..b0e877d 100644 --- a/server/path.go +++ b/server/path.go @@ -21,10 +21,10 @@ func NewPathFromLocal(p string) Path { href = splits[1] } href = path.Join("/notes", href) - return NewPath(href) + return NewPathFromURL(href) } -func NewPath(p string) Path { +func NewPathFromURL(p string) Path { base := path.Base(p) href := p local := strings.TrimPrefix(p, "/notes")