diff --git a/middleware/browse/browse.go b/middleware/browse/browse.go index 94741d9b..a6e8be86 100644 --- a/middleware/browse/browse.go +++ b/middleware/browse/browse.go @@ -196,7 +196,7 @@ func directoryListing(files []os.FileInfo, r *http.Request, canGoUp bool, root s fileCount++ } - url := url.URL{Path: name} + url := url.URL{Path: "./" + name} // prepend with "./" to fix paths with ':' in the name fileinfos = append(fileinfos, FileInfo{ IsDir: f.IsDir(), diff --git a/middleware/browse/browse_test.go b/middleware/browse/browse_test.go index a0c2cb24..f90f4f6f 100644 --- a/middleware/browse/browse_test.go +++ b/middleware/browse/browse_test.go @@ -147,11 +147,11 @@ func TestBrowseTemplate(t *testing.T) {

/photos/

-test.html
+test.html
-test2.html
+test2.html
-test3.html
+test3.html
@@ -209,7 +209,7 @@ func TestBrowseJson(t *testing.T) { name += "/" } - url := url.URL{Path: name} + url := url.URL{Path: "./" + name} fileinfos = append(fileinfos, FileInfo{ IsDir: f.IsDir(),