Skip to content

Commit

Permalink
revert: return check that page sha1 was not found
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyLewen committed Mar 5, 2024
1 parent 103569c commit edab71e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/crawler/crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,13 @@ func (c *Crawler) fetchSHA1(ctx context.Context, url string) ([]byte, error) {
}
defer func() { _ = resp.Body.Close() }()

// These are cases when version dir contains link to sha1 file
// But file doesn't exist
// e.g. https://repo.maven.apache.org/maven2/com/adobe/aem/uber-jar/6.4.8.2/uber-jar-6.4.8.2-sources.jar.sha1
if resp.StatusCode == http.StatusNotFound {
return nil, nil // TODO add special error for this
}

sha1, err := io.ReadAll(resp.Body)
if err != nil {
return nil, xerrors.Errorf("can't read sha1 %s: %w", url, err)
Expand Down

0 comments on commit edab71e

Please sign in to comment.