Skip to content

Open-source status page, incident response and uptime monitoring

🚑 assertion header

Thibault Le Ouay1a2abcbba7dc
diff --git a/apps/checker/cmd/main.go b/apps/checker/cmd/main.go
index fae202467..23c393649 100644
--- a/apps/checker/cmd/main.go
+++ b/apps/checker/cmd/main.go
@@ -115,14 +115,13 @@ func main() {
}
switch assert.AssertionType {
- case request.AssertionHeaders:
+ case request.AssertionHeader:
var target assertions.HeaderTarget
if err := json.Unmarshal(a, &target); err != nil {
return fmt.Errorf("unable to unmarshal IntTarget: %w", err)
}
isSuccessfull = isSuccessfull && target.HeaderEvaluate(res.Headers)
- fmt.Println("assertion type", assert.AssertionType)
case request.AssertionTextBody:
fmt.Println("assertion type", assert.AssertionType)
case request.AssertionStatus:
diff --git a/apps/checker/pkg/assertions/assertions.go b/apps/checker/pkg/assertions/assertions.go
index 78a751d2b..b6d2a6b87 100644
--- a/apps/checker/pkg/assertions/assertions.go
+++ b/apps/checker/pkg/assertions/assertions.go
@@ -61,8 +61,6 @@ func (target StringTargetType) StringEvaluate(s string) bool {
func (target HeaderTarget) HeaderEvaluate(s string) bool {
- fmt.Println(s)
-
headers := map[string]interface{}{}
if err := json.Unmarshal([]byte(s), &headers); err != nil {
diff --git a/apps/checker/request/request.go b/apps/checker/request/request.go
index 17fad3956..5f85cf999 100644
--- a/apps/checker/request/request.go
+++ b/apps/checker/request/request.go
@@ -5,7 +5,7 @@ import "encoding/json"
type AssertionType string
const (
- AssertionHeaders AssertionType = "headers"
+ AssertionHeader AssertionType = "header"
AssertionTextBody AssertionType = "textBody"
AssertionStatus AssertionType = "status"
AssertionJsonBody AssertionType = "jsonBody"