Skip to content

Commit 9008c3e

Browse files
committed
cli/daemon/objects: use http.ServeContent for handling range requests
1 parent 962f828 commit 9008c3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cli/daemon/objects/public.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package objects
22

33
import (
4+
"bytes"
45
"errors"
56
"fmt"
67
"io"
@@ -115,7 +116,7 @@ func (s *PublicBucketServer) handler(w http.ResponseWriter, req *http.Request) {
115116

116117
// Only write the body for GET requests, not HEAD
117118
if req.Method == "GET" {
118-
w.Write(contents)
119+
http.ServeContent(w, req, obj.Name, time.Time{}, bytes.NewReader(contents))
119120
}
120121
case "PUT":
121122
err := validateGcsSignedRequest(req, time.Now())

0 commit comments

Comments
 (0)