Clarify
parent
a6325abca3
commit
a8dcdf3765
|
|
@ -6,7 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *Server) notes(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) notes(w http.ResponseWriter, r *http.Request) {
|
||||||
p := NewPath(r.URL.Path)
|
p := NewPathFromURL(r.URL.Path)
|
||||||
if p.IsDir() {
|
if p.IsDir() {
|
||||||
head(w, r)
|
head(w, r)
|
||||||
notesHead(w, p)
|
notesHead(w, p)
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,10 @@ func NewPathFromLocal(p string) Path {
|
||||||
href = splits[1]
|
href = splits[1]
|
||||||
}
|
}
|
||||||
href = path.Join("/notes", href)
|
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)
|
base := path.Base(p)
|
||||||
href := p
|
href := p
|
||||||
local := strings.TrimPrefix(p, "/notes")
|
local := strings.TrimPrefix(p, "/notes")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue