fixed cache server
This commit is contained in:
parent
78b5e5f796
commit
550bc1ee2c
2 changed files with 4 additions and 4 deletions
|
|
@ -63,7 +63,7 @@ func (cs *CacheServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
h := w.Header()
|
h := w.Header()
|
||||||
if option == "v" {
|
if option == "v" {
|
||||||
h.Set(csp, videoCSP)
|
h.Set(csp, videoCSP)
|
||||||
err = video.Execute(w, r.URL.Path)
|
err = video.Execute(w, data{Paths: dirContents{Base: r.URL.Path}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
@ -94,7 +94,7 @@ func (cs *CacheServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
h.Set(csp, indexCSP)
|
h.Set(csp, indexCSP)
|
||||||
|
|
||||||
w.WriteHeader(i.Status())
|
w.WriteHeader(i.Status())
|
||||||
err = cache.Execute(w, paths)
|
err = cache.Execute(w, data{Paths: paths})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,14 @@
|
||||||
<td class="listoptions">[dir]</td>
|
<td class="listoptions">[dir]</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="spacer"><td colspan="2"></td></tr>
|
<tr class="spacer"><td colspan="2"></td></tr>
|
||||||
{{range $s := .Dirs -}}
|
{{range $s := .Paths.Dirs -}}
|
||||||
<tr class="listitem">
|
<tr class="listitem">
|
||||||
<td class="listpath"><a href="{{$s.URI}}">{{$s.Name}}</a></td>
|
<td class="listpath"><a href="{{$s.URI}}">{{$s.Name}}</a></td>
|
||||||
<td class="listoptions">[dir]</td>
|
<td class="listoptions">[dir]</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="spacer"><td colspan="2"></td></tr>
|
<tr class="spacer"><td colspan="2"></td></tr>
|
||||||
{{end -}}
|
{{end -}}
|
||||||
{{range $s := .Files -}}
|
{{range $s := .Paths.Files -}}
|
||||||
<tr class="listitem">
|
<tr class="listitem">
|
||||||
<td class="listpath"><a id="{{$s.Anchor}}" href="{{$s.URI}}">{{$s.Name}}</a></td>
|
<td class="listpath"><a id="{{$s.Anchor}}" href="{{$s.URI}}">{{$s.Name}}</a></td>
|
||||||
<td class="listoptions">
|
<td class="listoptions">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue