Skip to content

Find, verify, and analyze leaked credentials

Enhanced the eraser detector to handle new status code from verification API (#3342)

Kashif Khan49cb9d395d79
diff --git a/pkg/detectors/eraser/eraser.go b/pkg/detectors/eraser/eraser.go
index cc3d383c4..7df8d2c20 100644
--- a/pkg/detectors/eraser/eraser.go
+++ b/pkg/detectors/eraser/eraser.go
@@ -94,8 +94,8 @@ func verifyMatch(ctx context.Context, client *http.Client, token string) (bool,
switch res.StatusCode {
case http.StatusOK:
return true, nil, nil
- case http.StatusNotFound:
- // 404 API token not found
+ case http.StatusUnauthorized:
+ // 401 API token unauthorized
// The secret is determinately not verified (nothing to do)
return false, nil, nil
default: