diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2021-05-24 00:39:55 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-24 00:39:55 -0700 |
| commit | 15859a7daabd637cd91dede2cfc76d874e7174a4 (patch) | |
| tree | 5eb4f327c53e2525d372d19bce62984539c62e71 /weed/s3api/s3api_object_handlers.go | |
| parent | 359a08ecbad0b010811af367c2a2677fadfb53ae (diff) | |
| parent | 84dce32a5781268f6dbd0101e3bab65c04e0a1c7 (diff) | |
| download | seaweedfs-15859a7daabd637cd91dede2cfc76d874e7174a4.tar.xz seaweedfs-15859a7daabd637cd91dede2cfc76d874e7174a4.zip | |
Merge pull request #2074 from kmlebedev/head_check_all_chunks
avoid http error: superfluous response.WriteHeader
Diffstat (limited to 'weed/s3api/s3api_object_handlers.go')
| -rw-r--r-- | weed/s3api/s3api_object_handlers.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go index 370429106..2dde17b4c 100644 --- a/weed/s3api/s3api_object_handlers.go +++ b/weed/s3api/s3api_object_handlers.go @@ -332,7 +332,11 @@ func passThroughResponse(proxyResponse *http.Response, w http.ResponseWriter) { for k, v := range proxyResponse.Header { w.Header()[k] = v } - w.WriteHeader(proxyResponse.StatusCode) + if proxyResponse.Header.Get("Content-Range") != "" && proxyResponse.StatusCode == 200 { + w.WriteHeader(http.StatusPartialContent) + } else { + w.WriteHeader(proxyResponse.StatusCode) + } io.Copy(w, proxyResponse.Body) } |
