From 711c3f393980f96971904d52d078e8f272451374 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 22 Jan 2021 00:26:30 -0800 Subject: [PATCH] filer: fix http status 206 setting fix https://github.com/chrislusf/seaweedfs/issues/1753 --- weed/server/filer_server_handlers_read.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/server/filer_server_handlers_read.go b/weed/server/filer_server_handlers_read.go index 9fdc03dea..f77462adb 100644 --- a/weed/server/filer_server_handlers_read.go +++ b/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 { + if httpStatusCode != 0 { + w.WriteHeader(httpStatusCode) + } if offset+size <= int64(len(entry.Content)) { - if httpStatusCode != 0 { - w.WriteHeader(httpStatusCode) - } _, err := writer.Write(entry.Content[offset : offset+size]) return err }