aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2018-12-04 22:56:19 -0800
committerGitHub <noreply@github.com>2018-12-04 22:56:19 -0800
commit093f8bb91733801475baceabe40095160b008600 (patch)
treeaceadb104e9c6f6f32826518d3e82b1c6b34183b
parent060ce1d9a2f5498df24d0bd8bfb0b4a64f9b34d2 (diff)
parent31038acccf73541204b320fc334d0acad0b9923a (diff)
downloadseaweedfs-093f8bb91733801475baceabe40095160b008600.tar.xz
seaweedfs-093f8bb91733801475baceabe40095160b008600.zip
Merge pull request #781 from PapaYofen/fix-780
fix https://github.com/chrislusf/seaweedfs/issues/780
-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 {