diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 3e5f90e1..16ae68ee 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/setup-go@v6 with: - go-version: 1.24.1 + go-version: 1.24.4 repository: "${{ github.event.inputs.repository || 'TwiN/gatus' }}" ref: "${{ github.event.inputs.ref || 'master' }}" - uses: actions/checkout@v5 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 88cd42ef..de74fc2e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/setup-go@v6 with: - go-version: 1.24.1 + go-version: 1.24.4 - uses: actions/checkout@v5 - name: Build binary to make sure it works run: go build diff --git a/api/api.go b/api/api.go index 93f10f4a..9c422629 100644 --- a/api/api.go +++ b/api/api.go @@ -52,6 +52,7 @@ func (a *API) createRouter(cfg *config.Config) *fiber.App { }, ReadBufferSize: cfg.Web.ReadBufferSize, Network: fiber.NetworkTCP, + Immutable: true, // If not enabled, will cause issues due to fiber's zero allocation. See #1268 and https://docs.gofiber.io/#zero-allocation }) if os.Getenv("ENVIRONMENT") == "dev" { app.Use(cors.New(cors.Config{ diff --git a/api/external_endpoint.go b/api/external_endpoint.go index 2694c85c..16c1d088 100644 --- a/api/external_endpoint.go +++ b/api/external_endpoint.go @@ -56,8 +56,8 @@ func CreateExternalEndpointResult(cfg *config.Config) fiber.Handler { } result.Duration = parsedDuration } - if !result.Success && c.Query("error") != "" { - result.Errors = append(result.Errors, c.Query("error")) + if errorFromQuery := c.Query("error"); !result.Success && len(errorFromQuery) > 0 { + result.AddError(errorFromQuery) } convertedEndpoint := externalEndpoint.ToEndpoint() if err := store.Get().InsertEndpointResult(convertedEndpoint, result); err != nil { diff --git a/config/endpoint/result.go b/config/endpoint/result.go index 8164cd79..e2561f0e 100644 --- a/config/endpoint/result.go +++ b/config/endpoint/result.go @@ -72,5 +72,5 @@ func (r *Result) AddError(error string) { return } } - r.Errors = append(r.Errors, error) + r.Errors = append(r.Errors, error+"") } diff --git a/go.mod b/go.mod index 6cbc2231..e8c8b27d 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,14 @@ module github.com/TwiN/gatus/v5 -go 1.24.1 +go 1.24.4 + +toolchain go1.24.7 require ( code.gitea.io/sdk/gitea v0.21.0 github.com/TwiN/deepmerge v0.2.2 github.com/TwiN/g8/v2 v2.0.0 - github.com/TwiN/gocache/v2 v2.2.2 + github.com/TwiN/gocache/v2 v2.4.0 github.com/TwiN/health v1.6.0 github.com/TwiN/logr v0.3.1 github.com/TwiN/whois v1.1.11 diff --git a/go.sum b/go.sum index 442c1658..ddd63706 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,8 @@ github.com/TwiN/deepmerge v0.2.2 h1:FUG9QMIYg/j2aQyPPhA3XTFJwXSNHI/swaR4Lbyxwg4= github.com/TwiN/deepmerge v0.2.2/go.mod h1:4OHvjV3pPNJCJZBHswYAwk6rxiD8h8YZ+9cPo7nu4oI= github.com/TwiN/g8/v2 v2.0.0 h1:+hwIbRLMhDd2iwHzkZUPp2FkX7yTx8ddYOnS91HkDqQ= github.com/TwiN/g8/v2 v2.0.0/go.mod h1:4sVAF27q8T8ISggRa/Fb0drw7wpB22B6eWd+/+SGMqE= -github.com/TwiN/gocache/v2 v2.2.2 h1:4HToPfDV8FSbaYO5kkbhLpEllUYse5rAf+hVU/mSsuI= -github.com/TwiN/gocache/v2 v2.2.2/go.mod h1:WfIuwd7GR82/7EfQqEtmLFC3a2vqaKbs4Pe6neB7Gyc= +github.com/TwiN/gocache/v2 v2.4.0 h1:BZ/TqvhipDQE23MFFTjC0MiI1qZ7GEVtSdOFVVXyr18= +github.com/TwiN/gocache/v2 v2.4.0/go.mod h1:Cl1c0qNlQlXzJhTpAARVqpQDSuGDM5RhtzPYAM1x17g= github.com/TwiN/health v1.6.0 h1:L2ks575JhRgQqWWOfKjw9B0ec172hx7GdToqkYUycQM= github.com/TwiN/health v1.6.0/go.mod h1:Z6TszwQPMvtSiVx1QMidVRgvVr4KZGfiwqcD7/Z+3iw= github.com/TwiN/logr v0.3.1 h1:CfTKA83jUmsAoxqrr3p4JxEkqXOBnEE9/f35L5MODy4=