Skip to content

Commit

Permalink
fix: error returned by statObject for delete markers (#1531)
Browse files Browse the repository at this point in the history
  • Loading branch information
poornas authored Aug 23, 2021
1 parent 7877ed5 commit cee488b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api-stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ func (c Client) statObject(ctx context.Context, bucketName, objectName string, o
if err != nil {
return ObjectInfo{}, err
}
deleteMarker := resp.Header.Get(amzDeleteMarker) == "true"

if resp != nil {
deleteMarker := resp.Header.Get(amzDeleteMarker) == "true"
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusPartialContent {
if resp.StatusCode == http.StatusBadRequest && opts.VersionID != "" && deleteMarker {
if resp.StatusCode == http.StatusMethodNotAllowed && opts.VersionID != "" && deleteMarker {
errResp := ErrorResponse{
StatusCode: resp.StatusCode,
Code: "MethodNotAllowed",
Expand Down

0 comments on commit cee488b

Please sign in to comment.