From 700f18909831c56eebd0f645535a061f52ca5c1a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 31 Jan 2026 17:00:45 +0000 Subject: [PATCH] chore: update module github.com/gofiber/fiber/v2 to v2.52.11 --- go.mod | 2 +- go.sum | 4 +- vendor/github.com/gofiber/fiber/v2/AGENTS.md | 37 ++++++++++++++++++- vendor/github.com/gofiber/fiber/v2/app.go | 11 ++++-- .../gofiber/fiber/v2/log/default.go | 2 +- vendor/github.com/gofiber/fiber/v2/mount.go | 12 +++--- .../gofiber/fiber/v2/utils/common.go | 8 ++-- .../gofiber/fiber/v2/utils/strings.go | 13 +++++++ vendor/modules.txt | 2 +- 9 files changed, 70 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 51e6a20..95a998a 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.25.6 require ( github.com/ansrivas/fiberprometheus/v2 v2.15.0 github.com/fogleman/gg v1.3.0 - github.com/gofiber/fiber/v2 v2.52.10 + github.com/gofiber/fiber/v2 v2.52.11 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 github.com/prometheus/client_golang v1.23.2 github.com/samber/slog-fiber v1.20.1 diff --git a/go.sum b/go.sum index 1b50453..073bf27 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,8 @@ github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/gofiber/fiber/v2 v2.52.10 h1:jRHROi2BuNti6NYXmZ6gbNSfT3zj/8c0xy94GOU5elY= -github.com/gofiber/fiber/v2 v2.52.10/go.mod h1:YEcBbO/FB+5M1IZNBP9FO3J9281zgPAreiI1oqg8nDw= +github.com/gofiber/fiber/v2 v2.52.11 h1:5f4yzKLcBcF8ha1GQTWB+mpblWz3Vz6nSAbTL31HkWs= +github.com/gofiber/fiber/v2 v2.52.11/go.mod h1:YEcBbO/FB+5M1IZNBP9FO3J9281zgPAreiI1oqg8nDw= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= diff --git a/vendor/github.com/gofiber/fiber/v2/AGENTS.md b/vendor/github.com/gofiber/fiber/v2/AGENTS.md index 4b23d8d..ed23775 100644 --- a/vendor/github.com/gofiber/fiber/v2/AGENTS.md +++ b/vendor/github.com/gofiber/fiber/v2/AGENTS.md @@ -2,7 +2,15 @@ ## Agent Instructions -> **Note for the AI agent:** Before running the startup script, verify that all dependencies and CLI tools are already available. If a `vendor/` directory exists **or** `go list -m -mod=readonly all` succeeds (indicating modules are cached), you may skip the entire startup script—including all `go mod` commands and `go install` steps. Otherwise run the script as listed below. +> **Note for the AI agent:** Before running the startup script, verify that all dependencies and CLI tools are already available. If a `vendor/` directory exists **or** `go list -m -mod=readonly all` succeeds (indicating modules are cached), you may skip the entire startup script—including all `go mod` commands and `go install` steps. Otherwise, run the script as listed below. + +### General coding practices + +- When adding Go tests, always invoke `t.Parallel()` at the start of each test and subtest to maximize concurrency. +- Prefer `github.com/gofiber/utils/v2` helpers (for example, `utils.Trim`) when performing common operations such as string manipulation, whenever it is practical and appropriate for the surrounding code. +- Keep all protocol behavior RFC-compliant (e.g., HTTP/1.1 requirements) and document any intentional deviations. +- Protect hot paths from regressions: profile changes. +- Apply secure-by-default choices (validation, timeouts, sanitization) and ensure new code hardens attack surfaces. --- @@ -21,8 +29,9 @@ go install golang.org/x/vuln/cmd/govulncheck@latest # vulnerability scanner go install mvdan.cc/gofumpt@latest # code formatter go install github.com/tinylib/msgp@latest # msgp codegen - go install github.com/vburenin/ifacemaker@975a95966976eeb2d4365a7fb236e274c54da64c # interface impls + go install github.com/vburenin/ifacemaker@f30b6f9bdbed4b5c4804ec9ba4a04a999525c202 # interface impls go install github.com/dkorunic/betteralign/cmd/betteralign@latest # struct alignment + go install golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest go mod tidy # clean up go.mod & go.sum ``` @@ -40,5 +49,29 @@ Use `make help` to list all available commands. Common targets include: - **tidy**: clean and tidy dependencies. - **betteralign**: optimize struct field alignment. - **generate**: run `go generate` after installing msgp and ifacemaker. +- **modernize**: run golps modernize These targets can be invoked via `make ` as needed during development and testing. + +## Pull request guidelines + +- PR titles must start with a category prefix describing the change: `🐛 bug:`, `🔥 feat:`, `📒 docs:`, or `🧹 chore:`. +- Generated PR bodies should contain a **Summary** section that captures all changes included in the PR, not just the latest commit. + +## Programmatic checks + +Before presenting final changes or submitting a pull request, run each of the +following commands and ensure they succeed. Include the command outputs in your +final response to confirm they were executed: + +```bash +make audit +make generate +make betteralign +make modernize +make format +make lint +make test +``` + +All checks must pass before the generated code can be merged. diff --git a/vendor/github.com/gofiber/fiber/v2/app.go b/vendor/github.com/gofiber/fiber/v2/app.go index 8fa3bbf..766d050 100644 --- a/vendor/github.com/gofiber/fiber/v2/app.go +++ b/vendor/github.com/gofiber/fiber/v2/app.go @@ -30,7 +30,7 @@ import ( ) // Version of current fiber package -const Version = "2.52.10" +const Version = "2.52.11" // Handler defines a function to serve HTTP requests. type Handler = func(*Ctx) error @@ -1041,8 +1041,13 @@ func (app *App) ErrorHandler(ctx *Ctx, err error) error { mountedPrefixParts int ) - for prefix, subApp := range app.mountFields.appList { - if prefix != "" && strings.HasPrefix(ctx.path, prefix) { + normalizedPath := utils.AddTrailingSlash(ctx.Path()) + + for _, prefix := range app.mountFields.appListKeys { + subApp := app.mountFields.appList[prefix] + normalizedPrefix := utils.AddTrailingSlash(prefix) + + if prefix != "" && strings.HasPrefix(normalizedPath, normalizedPrefix) { parts := len(strings.Split(prefix, "/")) if mountedPrefixParts <= parts { if subApp.configured.ErrorHandler != nil { diff --git a/vendor/github.com/gofiber/fiber/v2/log/default.go b/vendor/github.com/gofiber/fiber/v2/log/default.go index 5cc7500..ff8de57 100644 --- a/vendor/github.com/gofiber/fiber/v2/log/default.go +++ b/vendor/github.com/gofiber/fiber/v2/log/default.go @@ -51,7 +51,7 @@ func (l *defaultLogger) privateLogf(lv Level, format string, fmtArgs []interface if len(fmtArgs) > 0 { _, _ = fmt.Fprintf(buf, format, fmtArgs...) } else { - _, _ = fmt.Fprint(buf, fmtArgs...) + _, _ = fmt.Fprint(buf, format) } _ = l.stdlog.Output(l.depth, buf.String()) //nolint:errcheck // It is fine to ignore the error buf.Reset() diff --git a/vendor/github.com/gofiber/fiber/v2/mount.go b/vendor/github.com/gofiber/fiber/v2/mount.go index b26eecc..d2d0bf8 100644 --- a/vendor/github.com/gofiber/fiber/v2/mount.go +++ b/vendor/github.com/gofiber/fiber/v2/mount.go @@ -45,11 +45,11 @@ func (app *App) Mount(prefix string, subApp *App) Router { } // Support for configs of mounted-apps and sub-mounted-apps - for mountedPrefixes, subApp := range subApp.mountFields.appList { + for mountedPrefixes, mountedApp := range subApp.mountFields.appList { path := getGroupPath(prefix, mountedPrefixes) - subApp.mountFields.mountPath = path - app.mountFields.appList[path] = subApp + mountedApp.mountFields.mountPath = path + app.mountFields.appList[path] = mountedApp } // register mounted group @@ -75,11 +75,11 @@ func (grp *Group) Mount(prefix string, subApp *App) Router { } // Support for configs of mounted-apps and sub-mounted-apps - for mountedPrefixes, subApp := range subApp.mountFields.appList { + for mountedPrefixes, mountedApp := range subApp.mountFields.appList { path := getGroupPath(groupPath, mountedPrefixes) - subApp.mountFields.mountPath = path - grp.app.mountFields.appList[path] = subApp + mountedApp.mountFields.mountPath = path + grp.app.mountFields.appList[path] = mountedApp } // register mounted group diff --git a/vendor/github.com/gofiber/fiber/v2/utils/common.go b/vendor/github.com/gofiber/fiber/v2/utils/common.go index 6c1dd1e..5a59da3 100644 --- a/vendor/github.com/gofiber/fiber/v2/utils/common.go +++ b/vendor/github.com/gofiber/fiber/v2/utils/common.go @@ -9,6 +9,7 @@ import ( "crypto/rand" "encoding/binary" "encoding/hex" + "fmt" "math" "net" "os" @@ -47,13 +48,10 @@ func UUID() string { // Setup seed & counter once uuidSetup.Do(func() { if _, err := rand.Read(uuidSeed[:]); err != nil { - return + panic(fmt.Errorf("utils: failed to seed UUID generator: %w", err)) } uuidCounter = binary.LittleEndian.Uint64(uuidSeed[:8]) }) - if atomic.LoadUint64(&uuidCounter) <= 0 { - return emptyUUID - } // first 8 bytes differ, taking a slice of the first 16 bytes x := atomic.AddUint64(&uuidCounter, 1) uuid := uuidSeed @@ -84,7 +82,7 @@ func UUID() string { func UUIDv4() string { token, err := googleuuid.NewRandom() if err != nil { - return UUID() + panic(fmt.Errorf("utils: failed to generate secure UUID: %w", err)) } return token.String() } diff --git a/vendor/github.com/gofiber/fiber/v2/utils/strings.go b/vendor/github.com/gofiber/fiber/v2/utils/strings.go index 109d132..8206c99 100644 --- a/vendor/github.com/gofiber/fiber/v2/utils/strings.go +++ b/vendor/github.com/gofiber/fiber/v2/utils/strings.go @@ -4,6 +4,10 @@ package utils +import ( + "strings" +) + // ToLower converts ascii string to lower-case func ToLower(b string) string { res := make([]byte, len(b)) @@ -73,3 +77,12 @@ func EqualFold(b, s string) bool { } return true } + +// AddTrailingSlash appends a trailing '/' to v if it does not already end with one +func AddTrailingSlash(s string) string { + if strings.HasSuffix(s, "/") { + return s + } + + return s + "/" +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b48468c..89ca204 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -14,7 +14,7 @@ github.com/cespare/xxhash/v2 # github.com/fogleman/gg v1.3.0 ## explicit github.com/fogleman/gg -# github.com/gofiber/fiber/v2 v2.52.10 +# github.com/gofiber/fiber/v2 v2.52.11 ## explicit; go 1.20 github.com/gofiber/fiber/v2 github.com/gofiber/fiber/v2/internal/schema