mirror of
https://github.com/rclone/rclone
synced 2024-12-01 10:31:57 +01:00
serve http: added content-length header when html directory is served
This commit is contained in:
parent
1890608f55
commit
6356b51b33
@ -235,6 +235,7 @@ func (d *Directory) Serve(w http.ResponseWriter, r *http.Request) {
|
|||||||
Error(d.DirRemote, w, "Failed to render template", err)
|
Error(d.DirRemote, w, "Failed to render template", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
w.Header().Set("Content-Length", fmt.Sprintf("%d", buf.Len()))
|
||||||
_, err = buf.WriteTo(w)
|
_, err = buf.WriteTo(w)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Error(d.DirRemote, nil, "Failed to drain template buffer", err)
|
Error(d.DirRemote, nil, "Failed to drain template buffer", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user