Skip to content

Commit

Permalink
fix: update to use http.StatusOK
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <[email protected]>
  • Loading branch information
JeyJeyGao committed Oct 31, 2024
1 parent 983f41c commit fb770b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion revocation/crl/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func fetchCRL(ctx context.Context, crlURL string, client *http.Client) (*x509.Re
return nil, fmt.Errorf("request failed: %w", err)
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("failed to download with status code: %d", resp.StatusCode)
}
// read with size limit
Expand Down
2 changes: 1 addition & 1 deletion revocation/internal/ocsp/ocsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func executeOCSPCheck(ctx context.Context, cert, issuer *x509.Certificate, serve
}
defer resp.Body.Close()

if resp.StatusCode != 200 {
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("failed to retrieve OCSP: response had status code %d", resp.StatusCode)
}

Expand Down

0 comments on commit fb770b4

Please sign in to comment.