aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-12-04 22:57:26 -0800
committerChris Lu <chris.lu@gmail.com>2018-12-04 22:57:26 -0800
commite2276b0626c9567033e610ace7e2cd6ab4dd20e1 (patch)
tree682d5569e65d226d2163c3b3748062d4b2445a5b
parent09383860e94e3d6f44a1c894a2782a953e07b451 (diff)
parent093f8bb91733801475baceabe40095160b008600 (diff)
downloadseaweedfs-e2276b0626c9567033e610ace7e2cd6ab4dd20e1.tar.xz
seaweedfs-e2276b0626c9567033e610ace7e2cd6ab4dd20e1.zip
Merge branch 'master' of https://github.com/chrislusf/seaweedfs
-rw-r--r--weed/operation/upload_content.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go
index 6eace2af5..9b5856949 100644
--- a/weed/operation/upload_content.go
+++ b/weed/operation/upload_content.go
@@ -92,6 +92,12 @@ func upload_content(uploadUrl string, fillBufferFunction func(w io.Writer) error
return nil, post_err
}
defer resp.Body.Close()
+
+ if resp.StatusCode < http.StatusOK ||
+ resp.StatusCode > http.StatusIMUsed {
+ return nil, errors.New(http.StatusText(resp.StatusCode))
+ }
+
etag := getEtag(resp)
resp_body, ra_err := ioutil.ReadAll(resp.Body)
if ra_err != nil {