Fixed files page

This commit is contained in:
Caleb Gardner
2024-08-07 03:36:15 -05:00
parent 1e9eeb25d1
commit da2db3ea9a
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ import (
"path/filepath"
)
const fileElement = "<p><a href='https://darkstorm.tech/%v/'>%v</a></p>"
const fileElement = "<p><a href='https://darkstorm.tech%v'>%v</a></p>"
func filesRequest(w http.ResponseWriter, r *http.Request) {
partPath := filepath.Clean(r.URL.Path)
@@ -38,7 +38,7 @@ func filesRequest(w http.ResponseWriter, r *http.Request) {
if f.IsDir() {
continue
}
pageContent += fmt.Sprintf(fileElement, partPath, f.Name())
pageContent += fmt.Sprintf(fileElement, filepath.Join(partPath, f.Name()), f.Name())
}
} else {
http.ServeFile(w, r, path)