Skip to content

Commit

Permalink
fix: http.responseContent
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Dec 9, 2024
1 parent 69f48c9 commit 8de9d9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion checks/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func (c *HTTPChecker) Check(ctx *context.Context, extConfig external.Check) pkg.
}

if check.ResponseContent != "" && !strings.Contains(responseBody, check.ResponseContent) {
return results.Failf("expected %v, found %v", check.ResponseContent, responseBody)
return results.Failf("expected %v, found %v", check.ResponseContent, pkg.TruncateMessage(responseBody))
}

if check.MaxSSLExpiry > 0 {
Expand Down
3 changes: 3 additions & 0 deletions fixtures/minimal/http_pass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ spec:
url: https://httpbin.demo.aws.flanksource.com/headers
test:
expr: json.headers["User-Agent"].startsWith("canary-checker/")
- name: http-body
url: https://httpbin.demo.aws.flanksource.com/html
responseContent: Herman Melville

0 comments on commit 8de9d9e

Please sign in to comment.