added back anchor and selfheal broken chunks

This commit is contained in:
ston1th 2022-10-09 01:12:05 +02:00
commit 6122768619
8 changed files with 65 additions and 44 deletions

View file

@ -82,7 +82,7 @@ func (cs *CacheServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.Del("Last-Modified")
paths, err := i.GetPaths(p, cs.fs, true)
paths, pathAnchor, err := i.GetPaths(p, cs.fs, true)
if err == io.EOF {
w.WriteHeader(i.Status())
return
@ -94,7 +94,7 @@ func (cs *CacheServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.Set(csp, indexCSP)
w.WriteHeader(i.Status())
err = cache.Execute(w, data{Paths: paths})
err = cache.Execute(w, data{Paths: paths, PathAnchor: pathAnchor})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return