mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 09:32:29 +08: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