Skip to content

Commit

Permalink
check for weird status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
rosecodym committed Aug 11, 2023
1 parent f2a0830 commit 7a27580
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/detectors/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
// 401 is bad key
if res.StatusCode == http.StatusOK || res.StatusCode == http.StatusForbidden {
secret.Verified = true
} else if res.StatusCode == http.StatusUnauthorized {
// Nothing to do; zero values of Result are the ones we want
} else {
secret.VerificationError = fmt.Errorf("unexpected HTTP response status %d", res.StatusCode)
}
}
}
Expand Down

0 comments on commit 7a27580

Please sign in to comment.