From 618b9ed5130722d1352bf3931bbe410af9b6dd22 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Mon, 21 Oct 2019 09:52:05 -0600 Subject: [PATCH] Fix serving . but absolute and parents still cause bugs --- server/path.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/path.go b/server/path.go index 2d1bd8f..b09dcaa 100755 --- a/server/path.go +++ b/server/path.go @@ -18,8 +18,10 @@ type Path struct { func NewPathFromLocal(p string) Path { splits := strings.SplitN(p, path.Base(config.Root), 2) href := splits[0] - if len(splits) > 1 { + if len(splits) > 1 && splits[0] == "" { href = splits[1] + } else { + href = strings.Join(splits, path.Base(config.Root)) } href = path.Join("/notes", href) return NewPathFromURL(href)