mirror of
https://github.com/rclone/rclone
synced 2024-12-25 17:03:45 +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)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Length", fmt.Sprintf("%d", buf.Len()))
|
||||
_, err = buf.WriteTo(w)
|
||||
if err != nil {
|
||||
Error(d.DirRemote, nil, "Failed to drain template buffer", err)
|
||||
|
Loading…
Reference in New Issue
Block a user