Skip to content

Commit

Permalink
restore: Accept http code 202 and 200 as valid response (#1621)
Browse files Browse the repository at this point in the history
202 to indicate that the server initiated the restore operation
200 to indicate that the server already initiated the restore operatn

But both can be considered a valid response if we don't want to break
the existing API.
  • Loading branch information
vadmeste authored Feb 9, 2022
1 parent bd1d875 commit 4f92000
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api-restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (c *Client) RestoreObject(ctx context.Context, bucketName, objectName, vers
if err != nil {
return err
}
if resp.StatusCode != http.StatusAccepted {
if resp.StatusCode != http.StatusAccepted && resp.StatusCode != http.StatusOK {
return httpRespToErrorResponse(resp, bucketName, "")
}
return nil
Expand Down

0 comments on commit 4f92000

Please sign in to comment.