master
scratch 2019-10-19 05:59:40 +00:00
parent a6325abca3
commit a8dcdf3765
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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")