added cache only access server
This commit is contained in:
parent
2a0801b015
commit
b5ae5504a7
6 changed files with 217 additions and 8 deletions
|
|
@ -91,7 +91,7 @@ func (r *responseInterceptor) Status() int {
|
|||
return r.status
|
||||
}
|
||||
|
||||
func (r *responseInterceptor) GetPaths(path string, fs *fs.FS) (dc dirContents, err error) {
|
||||
func (r *responseInterceptor) GetPaths(path string, fs *fs.FS, relative bool) (dc dirContents, err error) {
|
||||
buf := r.buf.Bytes()
|
||||
buf = bytes.ReplaceAll(buf, []byte{'&'}, []byte("&"))
|
||||
err = xml.Unmarshal(buf, &dc)
|
||||
|
|
@ -106,6 +106,9 @@ func (r *responseInterceptor) GetPaths(path string, fs *fs.FS) (dc dirContents,
|
|||
name := template.HTML(p)
|
||||
full := path + "/" + p
|
||||
uri := template.HTML(full)
|
||||
if relative {
|
||||
uri = template.HTML(p)
|
||||
}
|
||||
if p[len(p)-1] == '/' {
|
||||
dc.Dirs = append(dc.Dirs, dir{
|
||||
Name: name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue