Skip to content

Commit

Permalink
invert logic for sonarcloud (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin-decker authored Apr 28, 2022
1 parent 6b25502 commit 335a521
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/detectors/sonarcloud/sonarcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}

bodyString := string(bodyBytes)
validResponse := strings.Contains(bodyString, `"valid":false`)
validResponse := strings.Contains(bodyString, `"valid":true`)

defer res.Body.Close()
if res.StatusCode >= 200 && res.StatusCode < 300 {
if validResponse {
s1.Verified = false
} else {
s1.Verified = true
}
} else {
Expand Down

0 comments on commit 335a521

Please sign in to comment.