Added support 206 http code
GetObject query with Range header return 206 status code Change-Id: I4d29b8aab2e0f4e000cc0a32872a758b0c5bb1c3
This commit is contained in:
parent
c803f9803f
commit
c8dab92a7c
@ -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")
|
||||||
|
Loading…
Reference in New Issue
Block a user