Added support 206 http code

GetObject query with Range header return 206 status code

Change-Id: I4d29b8aab2e0f4e000cc0a32872a758b0c5bb1c3
This commit is contained in:
Krasilnikov Maxim 2016-07-07 12:55:33 +03:00 committed by Dean Troyer
parent c803f9803f
commit c8dab92a7c
1 changed files with 2 additions and 2 deletions

View File

@ -168,11 +168,11 @@ func (readCloser) Close() error {
// CheckHTTPResponseStatusCode compares http response header StatusCode against expected // CheckHTTPResponseStatusCode compares http response header StatusCode against expected
// statuses. Primary function is to ensure StatusCode is in the 20x (return nil). // statuses. Primary function is to ensure StatusCode is in the 20x (return nil).
// Ok: 200. Created: 201. Accepted: 202. No Content: 204. // Ok: 200. Created: 201. Accepted: 202. No Content: 204. Partial Content: 206.
// Otherwise return error message. // Otherwise return error message.
func CheckHTTPResponseStatusCode(resp *http.Response) error { func CheckHTTPResponseStatusCode(resp *http.Response) error {
switch resp.StatusCode { switch resp.StatusCode {
case 200, 201, 202, 204: case 200, 201, 202, 204, 206:
return nil return nil
case 400: case 400:
return errors.New("Error: response == 400 bad request") return errors.New("Error: response == 400 bad request")