From a8dcdf376586e0929cda613d8bdf5ccdf6972a84 Mon Sep 17 00:00:00 2001 From: scratch Date: Sat, 19 Oct 2019 05:59:40 +0000 Subject: [PATCH] Clarify --- server/notes.go | 2 +- server/path.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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")