Browse Source

filer: fix http status 206 setting

fix https://github.com/chrislusf/seaweedfs/issues/1753
pull/1759/head
Chris Lu 4 years ago
parent
commit
711c3f3939
  1. 2
      weed/server/filer_server_handlers_read.go

2
weed/server/filer_server_handlers_read.go

@ -159,10 +159,10 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
} }
processRangeRequest(r, w, totalSize, mimeType, func(writer io.Writer, offset int64, size int64, httpStatusCode int) error { processRangeRequest(r, w, totalSize, mimeType, func(writer io.Writer, offset int64, size int64, httpStatusCode int) error {
if offset+size <= int64(len(entry.Content)) {
if httpStatusCode != 0 { if httpStatusCode != 0 {
w.WriteHeader(httpStatusCode) w.WriteHeader(httpStatusCode)
} }
if offset+size <= int64(len(entry.Content)) {
_, err := writer.Write(entry.Content[offset : offset+size]) _, err := writer.Write(entry.Content[offset : offset+size])
return err return err
} }

Loading…
Cancel
Save