mirror of
https://github.com/nielsAD/autoindex.git
synced 2026-03-11 10:20:12 +01:00
Change sitemap.txt to urllist.txt
This commit is contained in:
9
fs.go
9
fs.go
@@ -465,12 +465,9 @@ func (fs *CachedFS) Sitemap(w http.ResponseWriter, r *http.Request) {
|
||||
goto interr
|
||||
}
|
||||
|
||||
l := len(path)
|
||||
if l > 1 {
|
||||
path = path[:l-1]
|
||||
}
|
||||
|
||||
w.Write([]byte(path))
|
||||
w.Write([]byte("https://"))
|
||||
w.Write([]byte(r.Host))
|
||||
w.Write([]byte(path[:len(path)-1]))
|
||||
w.Write([]byte{'\n'})
|
||||
}
|
||||
err = rows.Err()
|
||||
|
||||
2
main.go
2
main.go
@@ -90,7 +90,7 @@ func main() {
|
||||
srv := &http.Server{Addr: *addr}
|
||||
http.Handle("/idx/", limit.Handler(logRequest(http.StripPrefix("/idx/", fs))))
|
||||
http.Handle("/dl/", limit.Handler(logRequest(http.StripPrefix("/dl/", nodir(http.FileServer(http.Dir(fs.Root)))))))
|
||||
http.Handle("/sitemap.txt", http.HandlerFunc(fs.Sitemap))
|
||||
http.Handle("/urllist.txt", http.HandlerFunc(fs.Sitemap))
|
||||
http.Handle("/", pub)
|
||||
|
||||
go func() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
User-agent: *
|
||||
Disallow: /dl/
|
||||
Disallow: /idx/
|
||||
Sitemap: /sitemap.txt
|
||||
Sitemap: /urllist.txt
|
||||
|
||||
Reference in New Issue
Block a user