Skip to content

Commit 4f92000

Browse files
authored
restore: Accept http code 202 and 200 as valid response (#1621)
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.
1 parent bd1d875 commit 4f92000

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api-restore.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func (c *Client) RestoreObject(ctx context.Context, bucketName, objectName, vers
175175
if err != nil {
176176
return err
177177
}
178-
if resp.StatusCode != http.StatusAccepted {
178+
if resp.StatusCode != http.StatusAccepted && resp.StatusCode != http.StatusOK {
179179
return httpRespToErrorResponse(resp, bucketName, "")
180180
}
181181
return nil

0 commit comments

Comments
 (0)