Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Jun 18, 2024
1 parent 25e1040 commit 6f063a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/objects/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func (u URLSource) GetFile(ctx context.Context, filePath string, requestHeaders
return nil, FileState{}, fmt.Errorf("skipping %s: GET failed: %s", uri, err.Error())
}

if response.StatusCode != 200 && response.StatusCode != 304 {
if response.StatusCode != http.StatusOK && response.StatusCode != http.StatusNotModified {
return nil, FileState{}, fmt.Errorf(
"skipping %s: GET returned unexpected status code: expected 200 or 304, but got %d",
uri, response.StatusCode,
Expand All @@ -372,7 +372,7 @@ func (u URLSource) GetFile(ctx context.Context, filePath string, requestHeaders
LastModified: response.Header.Get("Last-Modified"),
SizeBytes: response.ContentLength,
ExpiryTime: nil, // no way to get this information via HTTP only
SkipTransfer: response.StatusCode == 304,
SkipTransfer: response.StatusCode == http.StatusNotModified,
ContentType: response.Header.Get("Content-Type"),
}, nil
}
Expand Down

0 comments on commit 6f063a6

Please sign in to comment.