From f416b9ab32ed01899ac16b2dd7ca9e7385f79c82 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 21 Oct 2025 13:30:18 -0400 Subject: [PATCH 01/34] link: Web Incubator Community Group (WICG) Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- docs/whats_new.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/whats_new.md b/docs/whats_new.md index 1ac9fa668ac..78b217f998f 100644 --- a/docs/whats_new.md +++ b/docs/whats_new.md @@ -1155,7 +1155,7 @@ We've made some changes to the CORS middleware to improve its functionality and #### New Struct Fields -- `Config.AllowPrivateNetwork`: This new field is a boolean that allows you to control whether private networks are allowed. This is related to the [Private Network Access (PNA)](https://wicg.github.io/private-network-access/) specification from the Web Incubator Community Group (WICG). When set to `true`, the CORS middleware will allow CORS preflight requests from private networks and respond with the `Access-Control-Allow-Private-Network: true` header. This could be useful in development environments or specific use cases, but should be done with caution due to potential security risks. +- `Config.AllowPrivateNetwork`: This new field is a boolean that allows you to control whether private networks are allowed. This is related to the [Private Network Access (PNA)](https://wicg.github.io/private-network-access/) specification from the [Web Incubator Community Group (WICG)](https://wicg.io/). When set to `true`, the CORS middleware will allow CORS preflight requests from private networks and respond with the `Access-Control-Allow-Private-Network: true` header. This could be useful in development environments or specific use cases, but should be done with caution due to potential security risks. #### Updated Struct Fields From f909857eb5f5cd5bdd8ce17931b7f276acf220db Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:53:37 -0400 Subject: [PATCH 02/34] spelling: ; otherwise, Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- app.go | 2 +- ctx_interface_gen.go | 2 +- docs/api/ctx.md | 2 +- middleware/limiter/limiter_sliding.go | 2 +- middleware/session/middleware.go | 4 ++-- middleware/session/session.go | 4 ++-- middleware/session/store.go | 2 +- middleware/static/static.go | 2 +- req.go | 2 +- res.go | 2 +- res_interface_gen.go | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app.go b/app.go index ba731e1c851..43f42c09ed4 100644 --- a/app.go +++ b/app.go @@ -1015,7 +1015,7 @@ func (app *App) HandlersCount() uint32 { // // Make sure the program doesn't exit and waits instead for Shutdown to return. // -// Important: app.Listen() must be called in a separate goroutine, otherwise shutdown hooks will not work +// Important: app.Listen() must be called in a separate goroutine; otherwise, shutdown hooks will not work // as Listen() is a blocking operation. Example: // // go app.Listen(":3000") diff --git a/ctx_interface_gen.go b/ctx_interface_gen.go index 3eb5c8bfe37..0a6016bf4a1 100644 --- a/ctx_interface_gen.go +++ b/ctx_interface_gen.go @@ -409,7 +409,7 @@ type Ctx interface { // Type sets the Content-Type HTTP header to the MIME type specified by the file extension. Type(extension string, charset ...string) Ctx // Vary adds the given header field to the Vary response header. - // This will append the header, if not already listed, otherwise leaves it listed in the current location. + // This will append the header, if not already listed; otherwise, leaves it listed in the current location. Vary(fields ...string) // Write appends p into response body. Write(p []byte) (int, error) diff --git a/docs/api/ctx.md b/docs/api/ctx.md index 8a9b5c6456c..cc37f8d1ed2 100644 --- a/docs/api/ctx.md +++ b/docs/api/ctx.md @@ -796,7 +796,7 @@ Make copies or use the [**`Immutable`**](./fiber.md#immutable) setting instead. ### Fresh -When the response is still **fresh** in the client's cache **true** is returned, otherwise **false** is returned to indicate that the client cache is now stale and the full response should be sent. +When the response is still **fresh** in the client's cache **true** is returned; otherwise, **false** is returned to indicate that the client cache is now stale and the full response should be sent. When a client sends the Cache-Control: no-cache request header to indicate an end-to-end reload request, `Fresh` will return false to make handling these requests transparent. diff --git a/middleware/limiter/limiter_sliding.go b/middleware/limiter/limiter_sliding.go index 5b6dd900862..08f3ef12f56 100644 --- a/middleware/limiter/limiter_sliding.go +++ b/middleware/limiter/limiter_sliding.go @@ -65,7 +65,7 @@ func (SlidingWindow) New(cfg Config) fiber.Handler { e.currHits = 0 // Check how much into the current window it currently is and sets the - // expiry based on that, otherwise this would only reset on + // expiry based on that; otherwise, this would only reset on // the next request and not show the correct expiry. elapsed := ts - e.exp if elapsed >= expiration { diff --git a/middleware/session/middleware.go b/middleware/session/middleware.go index 75b0c2ec3f9..7c1f6989017 100644 --- a/middleware/session/middleware.go +++ b/middleware/session/middleware.go @@ -170,7 +170,7 @@ func releaseMiddleware(m *Middleware) { // - c: The Fiber context. // // Returns: -// - *Middleware: The middleware object if found, otherwise nil. +// - *Middleware: The middleware object if found; otherwise, nil. // // Usage: // @@ -267,7 +267,7 @@ func (m *Middleware) Destroy() error { // Fresh checks if the session is fresh. // // Returns: -// - bool: True if the session is fresh, otherwise false. +// - bool: True if the session is fresh; otherwise, false. // // Usage: // diff --git a/middleware/session/session.go b/middleware/session/session.go index a3beed2c97e..00bc13679af 100644 --- a/middleware/session/session.go +++ b/middleware/session/session.go @@ -102,7 +102,7 @@ func releaseSession(s *Session) { // Fresh returns whether the session is new // // Returns: -// - bool: True if the session is fresh, otherwise false. +// - bool: True if the session is fresh; otherwise, false. // // Usage: // @@ -562,7 +562,7 @@ func (s *Session) absExpiration() time.Time { // current time is after the absolute expiration time. // // Returns: -// - bool: True if the session is expired, otherwise false. +// - bool: True if the session is expired; otherwise, false. func (s *Session) isAbsExpired() bool { absExpiration := s.absExpiration() return !absExpiration.IsZero() && time.Now().After(absExpiration) diff --git a/middleware/session/store.go b/middleware/session/store.go index a5affa267a0..4719528af94 100644 --- a/middleware/session/store.go +++ b/middleware/session/store.go @@ -266,7 +266,7 @@ func (s *Store) Delete(ctx context.Context, id string) error { // - id: The unique identifier of the session. // // Returns: -// - *Session: The session object if found, otherwise nil. +// - *Session: The session object if found; otherwise, nil. // - error: An error if the session retrieval fails or if the session ID is empty. // // Usage: diff --git a/middleware/static/static.go b/middleware/static/static.go index e6a4730173d..7b33fdf82a5 100644 --- a/middleware/static/static.go +++ b/middleware/static/static.go @@ -79,7 +79,7 @@ func sanitizePath(p []byte, filesystem fs.FS) ([]byte, error) { // New creates a new middleware handler. // The root argument specifies the root directory from which to serve static assets. // -// Note: Root has to be string or fs.FS, otherwise it will panic. +// Note: Root has to be string or fs.FS; otherwise, it will panic. func New(root string, cfg ...Config) fiber.Handler { config := configDefault(cfg...) diff --git a/req.go b/req.go index 834649764ef..d23c2b7af18 100644 --- a/req.go +++ b/req.go @@ -412,7 +412,7 @@ iploop: s := utils.TrimRight(headerValue[i:j], ' ') if r.c.app.config.EnableIPValidation { - // Skip validation if IP is clearly not IPv4/IPv6, otherwise validate without allocations + // Skip validation if IP is clearly not IPv4/IPv6; otherwise, validate without allocations if (!v6 && !v4) || (v6 && !utils.IsIPv6(s)) || (v4 && !utils.IsIPv4(s)) { continue iploop } diff --git a/res.go b/res.go index 05251a8831b..dc9c3f83dec 100644 --- a/res.go +++ b/res.go @@ -947,7 +947,7 @@ func shouldIncludeCharset(mimeType string) bool { } // Vary adds the given header field to the Vary response header. -// This will append the header, if not already listed, otherwise leaves it listed in the current location. +// This will append the header, if not already listed; otherwise, leaves it listed in the current location. func (r *DefaultRes) Vary(fields ...string) { r.Append(HeaderVary, fields...) } diff --git a/res_interface_gen.go b/res_interface_gen.go index b8c014e9a1a..b4a90590734 100644 --- a/res_interface_gen.go +++ b/res_interface_gen.go @@ -144,7 +144,7 @@ type Res interface { // Type sets the Content-Type HTTP header to the MIME type specified by the file extension. Type(extension string, charset ...string) Ctx // Vary adds the given header field to the Vary response header. - // This will append the header, if not already listed, otherwise leaves it listed in the current location. + // This will append the header, if not already listed; otherwise, leaves it listed in the current location. Vary(fields ...string) // Write appends p into response body. Write(p []byte) (int, error) From f7460d1403a6916766e21e0777652be9fd2df92e Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:50:59 -0400 Subject: [PATCH 03/34] spelling: a key, the value Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- ctx_interface_gen.go | 2 +- req.go | 2 +- req_interface_gen.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ctx_interface_gen.go b/ctx_interface_gen.go index 0a6016bf4a1..8da451c07f2 100644 --- a/ctx_interface_gen.go +++ b/ctx_interface_gen.go @@ -254,7 +254,7 @@ type Ctx interface { // Otherwise, it updates the context's method and returns the overridden method as a string. Method(override ...string) string // MultipartForm parse form entries from binary. - // This returns a map[string][]string, so given a key the value will be a string slice. + // This returns a map[string][]string, so given a key, the value will be a string slice. MultipartForm() (*multipart.Form, error) // Params is used to get the route parameters. // Defaults to empty string "" if the param doesn't exist. diff --git a/req.go b/req.go index d23c2b7af18..8d1282a25b7 100644 --- a/req.go +++ b/req.go @@ -560,7 +560,7 @@ func (r *DefaultReq) Method(override ...string) string { } // MultipartForm parse form entries from binary. -// This returns a map[string][]string, so given a key the value will be a string slice. +// This returns a map[string][]string, so given a key, the value will be a string slice. func (r *DefaultReq) MultipartForm() (*multipart.Form, error) { return r.c.fasthttp.MultipartForm() } diff --git a/req_interface_gen.go b/req_interface_gen.go index 77b5549719a..5f854115d63 100644 --- a/req_interface_gen.go +++ b/req_interface_gen.go @@ -121,7 +121,7 @@ type Req interface { // Otherwise, it updates the context's method and returns the overridden method as a string. Method(override ...string) string // MultipartForm parse form entries from binary. - // This returns a map[string][]string, so given a key the value will be a string slice. + // This returns a map[string][]string, so given a key, the value will be a string slice. MultipartForm() (*multipart.Form, error) // OriginalURL contains the original request URL. // Returned value is only valid within the handler. Do not store any references. From 06f420c1e8504c90aa3afc99450130bf5a9ff5c9 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:21:04 -0400 Subject: [PATCH 04/34] spelling: a Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- app_test.go | 4 ++-- bind.go | 2 +- middleware/cache/cache_test.go | 2 +- middleware/cache/config.go | 2 +- middleware/proxy/proxy.go | 6 +++--- path_testcases_test.go | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app_test.go b/app_test.go index 683ed73a7b1..1c0766d7922 100644 --- a/app_test.go +++ b/app_test.go @@ -530,7 +530,7 @@ func Test_App_ErrorHandler_Custom(t *testing.T) { t.Parallel() app := New(Config{ ErrorHandler: func(c Ctx, _ error) error { - return c.Status(200).SendString("hi, i'm an custom error") + return c.Status(200).SendString("hi, i'm a custom error") }, }) @@ -544,7 +544,7 @@ func Test_App_ErrorHandler_Custom(t *testing.T) { body, err := io.ReadAll(resp.Body) require.NoError(t, err) - require.Equal(t, "hi, i'm an custom error", string(body)) + require.Equal(t, "hi, i'm a custom error", string(body)) } func Test_App_ErrorHandler_HandlerStack(t *testing.T) { diff --git a/bind.go b/bind.go index 6376fa7481b..0780a3ca55b 100644 --- a/bind.go +++ b/bind.go @@ -151,7 +151,7 @@ func (b *Bind) RespHeader(out any) error { } // Cookie binds the request cookie strings into the struct, map[string]string and map[string][]string. -// NOTE: If your cookie is like key=val1,val2; they'll be binded as an slice if your map is map[string][]string. Else, it'll use last element of cookie. +// NOTE: If your cookie is like key=val1,val2; they'll be binded as a slice if your map is map[string][]string. Else, it'll use last element of cookie. func (b *Bind) Cookie(out any) error { bind := binder.GetFromThePool[*binder.CookieBinding](&binder.CookieBinderPool) bind.EnableSplitting = b.ctx.App().config.EnableSplittingOnParsers diff --git a/middleware/cache/cache_test.go b/middleware/cache/cache_test.go index 3a1b2a26edb..7176fcb34f4 100644 --- a/middleware/cache/cache_test.go +++ b/middleware/cache/cache_test.go @@ -1073,7 +1073,7 @@ func Test_CacheStorage_CustomHeaders(t *testing.T) { } // Because time points are updated once every X milliseconds, entries in tests can often have -// equal expiration times and thus be in an random order. This closure hands out increasing +// equal expiration times and thus be in a random order. This closure hands out increasing // time intervals to maintain strong ascending order of expiration func stableAscendingExpiration() func(c1 fiber.Ctx, c2 *Config) time.Duration { i := 0 diff --git a/middleware/cache/config.go b/middleware/cache/config.go index e8e7156ee8c..4fb01c0aafe 100644 --- a/middleware/cache/config.go +++ b/middleware/cache/config.go @@ -50,7 +50,7 @@ type Config struct { // Default: []string{fiber.MethodGet, fiber.MethodHead} Methods []string - // Expiration is the time that an cached response will live + // Expiration is the time that a cached response will live // // Optional. Default: 5 * time.Minute Expiration time.Duration diff --git a/middleware/proxy/proxy.go b/middleware/proxy/proxy.go index a0056cc8802..b74cbff96ad 100644 --- a/middleware/proxy/proxy.go +++ b/middleware/proxy/proxy.go @@ -123,7 +123,7 @@ func WithClient(cli *fasthttp.Client) { } // Forward performs the given http request and fills the given http response. -// This method will return an fiber.Handler +// This method will return a fiber.Handler func Forward(addr string, clients ...*fasthttp.Client) fiber.Handler { return func(c fiber.Ctx) error { return Do(c, addr, clients...) @@ -210,7 +210,7 @@ func getScheme(uri []byte) []byte { } // DomainForward performs an http request based on the given domain and populates the given http response. -// This method will return an fiber.Handler +// This method will return a fiber.Handler func DomainForward(hostname, addr string, clients ...*fasthttp.Client) fiber.Handler { return func(c fiber.Ctx) error { host := string(c.Request().Host()) @@ -243,7 +243,7 @@ func (r *roundrobin) get() string { } // BalancerForward Forward performs the given http request with round robin algorithm to server and fills the given http response. -// This method will return an fiber.Handler +// This method will return a fiber.Handler func BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler { r := &roundrobin{ current: 0, diff --git a/path_testcases_test.go b/path_testcases_test.go index bb6e2e831ee..b76ee866bff 100644 --- a/path_testcases_test.go +++ b/path_testcases_test.go @@ -248,7 +248,7 @@ func init() { {url: "/fooba", params: nil, match: false}, }, }, - // chars in front of an parameter + // chars in front of a parameter { pattern: "/name::name", testCases: []routeTestCase{ From 5a5bdde38b921c721f97818eb898893105c6c35d Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:53:31 -0400 Subject: [PATCH 05/34] spelling: before returning Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- middleware/logger/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/logger/config.go b/middleware/logger/config.go index 4c23b435cf9..6c550f949b7 100644 --- a/middleware/logger/config.go +++ b/middleware/logger/config.go @@ -36,7 +36,7 @@ type Config struct { // Optional. Default: map[string]LogFunc CustomTags map[string]LogFunc - // You can define specific things before the returning the handler: colors, template, etc. + // You can define specific things before returning the handler: colors, template, etc. // // Optional. Default: beforeHandlerFunc BeforeHandlerFunc func(Config) From 6fc2b4f5f7e996fdaaaff97066d42ba53b1adf8f Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:08:34 -0400 Subject: [PATCH 06/34] spelling: beginning Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- path.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/path.go b/path.go index 663f0d88280..3226d55e41e 100644 --- a/path.go +++ b/path.go @@ -259,7 +259,7 @@ func addParameterMetaInfo(segs []*routeSegment) []*routeSegment { } } - // loop from begin to end + // loop from beginning to end for i := range segLen { // check how often the compare part is in the following const parts if segs[i].IsParam { From d781e0961aec6c8a96c4c9f4d626c948d706140c Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:21:10 -0400 Subject: [PATCH 07/34] spelling: bound Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- bind.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bind.go b/bind.go index 0780a3ca55b..27493a28585 100644 --- a/bind.go +++ b/bind.go @@ -151,7 +151,7 @@ func (b *Bind) RespHeader(out any) error { } // Cookie binds the request cookie strings into the struct, map[string]string and map[string][]string. -// NOTE: If your cookie is like key=val1,val2; they'll be binded as a slice if your map is map[string][]string. Else, it'll use last element of cookie. +// NOTE: If your cookie is like key=val1,val2; they'll be bound as a slice if your map is map[string][]string. Else, it'll use last element of cookie. func (b *Bind) Cookie(out any) error { bind := binder.GetFromThePool[*binder.CookieBinding](&binder.CookieBinderPool) bind.EnableSplitting = b.ctx.App().config.EnableSplittingOnParsers From 3d79ef94b10dc3d3a8536e2cc21d328b29332a29 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:50:01 -0400 Subject: [PATCH 08/34] spelling: case-insensitive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- client/client_test.go | 2 +- ctx_test.go | 4 ++-- helpers.go | 2 +- helpers_test.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/client_test.go b/client/client_test.go index e14f1e4e47a..216d1818a54 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -1338,7 +1338,7 @@ func Test_Client_Header(t *testing.T) { require.Equal(t, "foo", res[0]) }) - t.Run("set header case insensitive", func(t *testing.T) { + t.Run("set header case-insensitive", func(t *testing.T) { t.Parallel() req := New() req.SetHeader("foo", "bar"). diff --git a/ctx_test.go b/ctx_test.go index 30afa070d84..f9f9dbc3e2f 100644 --- a/ctx_test.go +++ b/ctx_test.go @@ -3307,7 +3307,7 @@ func Test_Ctx_Path(t *testing.T) { app.Get("/test/:user", func(c Ctx) error { require.Equal(t, "/Test/John", c.Path()) require.Equal(t, "/Test/John", string(c.Request().URI().Path())) - // not strict && case insensitive + // not strict && case-insensitive require.Equal(t, "/ABC/", c.Path("/ABC/")) require.Equal(t, "/ABC/", string(c.Request().URI().Path())) require.Equal(t, "/test/john/", c.Path("/test/john/")) @@ -5583,7 +5583,7 @@ func Benchmark_Ctx_Get_Location_From_Route(b *testing.B) { func Test_Ctx_Get_Location_From_Route_name(t *testing.T) { t.Parallel() - t.Run("case insensitive", func(t *testing.T) { + t.Run("case-insensitive", func(t *testing.T) { t.Parallel() app := New() c := app.AcquireCtx(&fasthttp.RequestCtx{}) diff --git a/helpers.go b/helpers.go index 83c2057c1b0..bc5baa5ee63 100644 --- a/helpers.go +++ b/helpers.go @@ -308,7 +308,7 @@ func acceptsOfferType(spec, offerType string, specParams headerParams) bool { } // paramsMatch returns whether offerParams contains all parameters present in specParams. -// Matching is case insensitive, and surrounding quotes are stripped. +// Matching is case-insensitive, and surrounding quotes are stripped. // To align with the behavior of res.format from Express, the order of parameters is // ignored, and if a parameter is specified twice in the incoming Accept, the last // provided value is given precedence. diff --git a/helpers_test.go b/helpers_test.go index bd95653c994..c564cf8d3cc 100644 --- a/helpers_test.go +++ b/helpers_test.go @@ -222,7 +222,7 @@ func Test_Utils_ParamsMatch(t *testing.T) { match: true, }, { - description: "case insensitive", + description: "case-insensitive", accept: headerParams{"ParaM": []byte("FoO")}, offer: ";pAram=foO", match: true, From c2c31e5bd6d3137250b1e99b5024339f4e3286d8 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 23:37:48 -0400 Subject: [PATCH 09/34] spelling: case-sensitive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- ctx_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctx_test.go b/ctx_test.go index f9f9dbc3e2f..07b78d7ea3e 100644 --- a/ctx_test.go +++ b/ctx_test.go @@ -5600,7 +5600,7 @@ func Test_Ctx_Get_Location_From_Route_name(t *testing.T) { require.Equal(t, "/user/fiber", location) }) - t.Run("case sensitive", func(t *testing.T) { + t.Run("case-sensitive", func(t *testing.T) { t.Parallel() app := New(Config{CaseSensitive: true}) c := app.AcquireCtx(&fasthttp.RequestCtx{}) From cb913cba47f6243cd2e495392cc65e78d998af77 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 23:47:27 -0400 Subject: [PATCH 10/34] spelling: circle Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- client/hooks_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/hooks_test.go b/client/hooks_test.go index 6766cacc908..32d6eb749bf 100644 --- a/client/hooks_test.go +++ b/client/hooks_test.go @@ -326,7 +326,7 @@ func Test_Parser_Request_Header(t *testing.T) { req := AcquireRequest(). SetFormDataWithMap(map[string]string{ "foo": "bar", - "ball": "cricle and square", + "ball": "circle and square", }) err := parserRequestHeader(client, req) @@ -531,12 +531,12 @@ func Test_Parser_Request_Body(t *testing.T) { client := New() req := AcquireRequest(). SetFormDataWithMap(map[string]string{ - "ball": "cricle and square", + "ball": "circle and square", }) err := parserRequestBody(client, req) require.NoError(t, err) - require.Equal(t, "ball=cricle+and+square", string(req.RawRequest.Body())) + require.Equal(t, "ball=circle+and+square", string(req.RawRequest.Body())) }) t.Run("form data body error", func(t *testing.T) { From 391f593ce61ae1e2c5948c7d1400cd8f5b68d4aa Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:53:15 -0400 Subject: [PATCH 11/34] spelling: defines methods Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- docs/api/services.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/services.md b/docs/api/services.md index 52525920115..f5fddab625b 100644 --- a/docs/api/services.md +++ b/docs/api/services.md @@ -10,7 +10,7 @@ After adding a service to the app configuration, Fiber starts it on launch and s ## Service Interface -The `Service` interface defines the methods a service must implement. +The `Service` interface defines methods a service must implement. ### Definition From bd41d99c7ae5b62443ffdd624a3fa4a08758f4f1 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:55:24 -0400 Subject: [PATCH 12/34] spelling: fall back Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- docs/guide/extractors.md | 2 +- docs/middleware/csrf.md | 2 +- middleware/csrf/csrf_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/guide/extractors.md b/docs/guide/extractors.md index cbc1b42fb8c..939ea4d57e5 100644 --- a/docs/guide/extractors.md +++ b/docs/guide/extractors.md @@ -201,7 +201,7 @@ Different extraction sources have different security properties and use cases: When using multiple sources, order them by your security preferences: ```go -// Example: Prefer headers, fallback to cookies, then query +// Example: Prefer headers, fall back to cookies, then query extractors.Chain( extractors.FromAuthHeader("Bearer"), // Standard auth extractors.FromCookie("auth_token"), // Secure storage diff --git a/docs/middleware/csrf.md b/docs/middleware/csrf.md index 931b030b02c..c5d7cb39881 100644 --- a/docs/middleware/csrf.md +++ b/docs/middleware/csrf.md @@ -300,7 +300,7 @@ You can create advanced extractors for use cases like JWT embedding or JSON body For applications that need to support both AJAX and form submissions: ```go -// Try header first (AJAX), fallback to form (traditional forms) +// Try header first (AJAX), fall back to form (traditional forms) app.Use(csrf.New(csrf.Config{ Extractor: extractors.Chain( extractors.FromHeader("X-Csrf-Token"), diff --git a/middleware/csrf/csrf_test.go b/middleware/csrf/csrf_test.go index e7e0ad60f28..729fcd218c4 100644 --- a/middleware/csrf/csrf_test.go +++ b/middleware/csrf/csrf_test.go @@ -1763,7 +1763,7 @@ func Test_CSRF_Chain_Extractor(t *testing.T) { t.Parallel() app := fiber.New() - // Chain extractor: try header first, fallback to form + // Chain extractor: try header first, fall back to form chainExtractor := extractors.Chain( extractors.FromHeader("X-Csrf-Token"), extractors.FromForm("_csrf"), From e16d1c60db7c040f647167610cc6d5e3425e4efe Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:47:33 -0400 Subject: [PATCH 13/34] spelling: fallback Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- docs/api/state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/state.md b/docs/api/state.md index 5d6bd66d0c7..ca0a3e6a446 100644 --- a/docs/api/state.md +++ b/docs/api/state.md @@ -464,7 +464,7 @@ func GetStateWithDefault[T any](s *State, key string, defaultVal T) T **Usage Example:** ```go -// Retrieve a value with a default fallback. +// Retrieve a value with a fallback. requestCount := GetStateWithDefault[int](app.State(), "requestCount", 0) fmt.Printf("Request Count: %d\n", requestCount) ``` From 7d97b48af51a7a2c3d40490ee56e0d6ca66a102a Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:56:19 -0400 Subject: [PATCH 14/34] spelling: github Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- app.go | 2 +- app_test.go | 2 +- color.go | 2 +- ctx.go | 2 +- ctx_interface.go | 2 +- ctx_test.go | 2 +- group.go | 2 +- helpers.go | 2 +- helpers_test.go | 2 +- listen.go | 2 +- mount.go | 2 +- mount_test.go | 2 +- path.go | 2 +- path_test.go | 2 +- path_testcases_test.go | 2 +- prefork_test.go | 2 +- redirect.go | 2 +- redirect_test.go | 2 +- register.go | 2 +- router.go | 2 +- router_test.go | 10 +++++----- 21 files changed, 25 insertions(+), 25 deletions(-) diff --git a/app.go b/app.go index 43f42c09ed4..aa21781ca67 100644 --- a/app.go +++ b/app.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io // Package fiber is an Express inspired web framework built on top of Fasthttp, diff --git a/app_test.go b/app_test.go index 1c0766d7922..f576da39069 100644 --- a/app_test.go +++ b/app_test.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/color.go b/color.go index cbccd2ebee7..a1d362a4e40 100644 --- a/color.go +++ b/color.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/ctx.go b/ctx.go index d876d9d78ee..92be086524f 100644 --- a/ctx.go +++ b/ctx.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/ctx_interface.go b/ctx_interface.go index f6f76361c87..071e328c2ae 100644 --- a/ctx_interface.go +++ b/ctx_interface.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/ctx_test.go b/ctx_test.go index 07b78d7ea3e..5de8256415c 100644 --- a/ctx_test.go +++ b/ctx_test.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/group.go b/group.go index 4e74bad8289..22430658d92 100644 --- a/group.go +++ b/group.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/helpers.go b/helpers.go index bc5baa5ee63..f61fbdbd995 100644 --- a/helpers.go +++ b/helpers.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/helpers_test.go b/helpers_test.go index c564cf8d3cc..ba347275c61 100644 --- a/helpers_test.go +++ b/helpers_test.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ“ Github Repository: https://github.com/gofiber/fiber +// πŸ“ GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/listen.go b/listen.go index 0d8e9fcb864..9ea364b9a78 100644 --- a/listen.go +++ b/listen.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/mount.go b/mount.go index 0b1a0f5d5bd..687063c2bcd 100644 --- a/mount.go +++ b/mount.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/mount_test.go b/mount_test.go index bc32f005458..0870910945d 100644 --- a/mount_test.go +++ b/mount_test.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/path.go b/path.go index 3226d55e41e..adb6d70e517 100644 --- a/path.go +++ b/path.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ“„ Github Repository: https://github.com/gofiber/fiber +// πŸ“„ GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io // ⚠️ This path parser was inspired by ucarion/urlpath (MIT License). // πŸ’– Maintained and modified for Fiber by @renewerner87 diff --git a/path_test.go b/path_test.go index 6a9dc77b6dc..3290e58ebd9 100644 --- a/path_test.go +++ b/path_test.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ“ Github Repository: https://github.com/gofiber/fiber +// πŸ“ GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/path_testcases_test.go b/path_testcases_test.go index b76ee866bff..343533be81c 100644 --- a/path_testcases_test.go +++ b/path_testcases_test.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ“ Github Repository: https://github.com/gofiber/fiber +// πŸ“ GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/prefork_test.go b/prefork_test.go index 2ad700ca24f..cff6e125f74 100644 --- a/prefork_test.go +++ b/prefork_test.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ“„ Github Repository: https://github.com/gofiber/fiber +// πŸ“„ GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io // πŸ’– Maintained and modified for Fiber by @renewerner87 package fiber diff --git a/redirect.go b/redirect.go index ac17c48b343..d6f0020fc8d 100644 --- a/redirect.go +++ b/redirect.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ“ Github Repository: https://github.com/gofiber/fiber +// πŸ“ GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/redirect_test.go b/redirect_test.go index 89e01127024..2ffef1cd6c1 100644 --- a/redirect_test.go +++ b/redirect_test.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ“ Github Repository: https://github.com/gofiber/fiber +// πŸ“ GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/register.go b/register.go index 65e5acd84f9..edb8587dad0 100644 --- a/register.go +++ b/register.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/router.go b/router.go index 084375bc7e5..d69170266bb 100644 --- a/router.go +++ b/router.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ€– Github Repository: https://github.com/gofiber/fiber +// πŸ€– GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber diff --git a/router_test.go b/router_test.go index 4bc7feb6e17..e2ef1613c5e 100644 --- a/router_test.go +++ b/router_test.go @@ -1,5 +1,5 @@ // ⚑️ Fiber is an Express inspired web framework written in Go with β˜•οΈ -// πŸ“ƒ Github Repository: https://github.com/gofiber/fiber +// πŸ“ƒ GitHub Repository: https://github.com/gofiber/fiber // πŸ“Œ API Documentation: https://docs.gofiber.io package fiber @@ -1204,7 +1204,7 @@ func registerDummyRoutes(app *App) { h := func(_ Ctx) error { return nil } - for _, r := range routesFixture.GithubAPI { + for _, r := range routesFixture.GitHubAPI { app.Add([]string{r.Method}, r.Path, h) } } @@ -1589,8 +1589,8 @@ func Benchmark_Router_Handler_StrictRouting(b *testing.B) { } } -// go test -run=^$ -bench=Benchmark_Router_Github_API -benchmem -count=16 -func Benchmark_Router_Github_API(b *testing.B) { +// go test -run=^$ -bench=Benchmark_Router_GitHub_API -benchmem -count=16 +func Benchmark_Router_GitHub_API(b *testing.B) { app := New() registerDummyRoutes(app) app.startupProcess() @@ -1625,7 +1625,7 @@ type testRoute struct { type routeJSON struct { TestRoutes []testRoute `json:"test_routes"` - GithubAPI []testRoute `json:"github_api"` + GitHubAPI []testRoute `json:"github_api"` } func newCustomApp() *App { From eeb1f57db29d7ebf72cc376df09df61b35a65fd3 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:34:57 -0400 Subject: [PATCH 15/34] spelling: if there is no value for the key Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- req.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/req.go b/req.go index 8d1282a25b7..a3e51a72439 100644 --- a/req.go +++ b/req.go @@ -590,7 +590,7 @@ func (r *DefaultReq) Params(key string, defaultValue ...string) string { continue } if route.Params[i] == key || (!app.config.CaseSensitive && utils.EqualFold(route.Params[i], key)) { - // in case values are not here + // if there is no value for the key if len(values) <= i || len(values[i]) == 0 { break } From e3e64dfd18c5e2d24138379e5bccb80d6f37a06e Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:35:14 -0400 Subject: [PATCH 16/34] spelling: if Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- middleware/earlydata/config.go | 2 +- req.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/middleware/earlydata/config.go b/middleware/earlydata/config.go index ced705dd570..397c364c2b6 100644 --- a/middleware/earlydata/config.go +++ b/middleware/earlydata/config.go @@ -26,7 +26,7 @@ type Config struct { // Optional. Default: a function which rejects the request on unsafe and allows the request on safe HTTP request methods. AllowEarlyData func(c fiber.Ctx) bool - // Error is returned in case an early-data request is rejected. + // Error is returned if an early-data request is rejected. // // Optional. Default: fiber.ErrTooEarly. Error error diff --git a/req.go b/req.go index a3e51a72439..ff2c21864d0 100644 --- a/req.go +++ b/req.go @@ -717,7 +717,7 @@ func (r *DefaultReq) Queries() map[string]string { // It takes the following parameters: // - c: The context object representing the current request. // - key: The name of the query parameter. -// - defaultValue: (Optional) The default value to return in case the query parameter is not found or cannot be parsed. +// - defaultValue: (Optional) The default value to return if the query parameter is not found or cannot be parsed. // The function performs the following steps: // 1. Type-asserts the context object to *DefaultCtx. // 2. Retrieves the raw query parameter value from the request's URI. From 2b6394e3afb75c72ea7f327ce01ae6c50df4d631 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:46:14 -0400 Subject: [PATCH 17/34] spelling: its Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- redirect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redirect.go b/redirect.go index d6f0020fc8d..a0b512c1969 100644 --- a/redirect.go +++ b/redirect.go @@ -85,7 +85,7 @@ func AcquireRedirect() *Redirect { // ReleaseRedirect returns c acquired via Redirect to redirect pool. // -// It is forbidden accessing req and/or its' members after returning +// It is forbidden accessing req and/or its members after returning // it to redirect pool. func ReleaseRedirect(r *Redirect) { r.release() From 37f7bf2a55c21f68f5f61d41fff59ea865620500 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 23:49:01 -0400 Subject: [PATCH 18/34] spelling: longest Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- middleware/logger/logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/logger/logger.go b/middleware/logger/logger.go index 7d4befc9213..1ece7f4ca8c 100644 --- a/middleware/logger/logger.go +++ b/middleware/logger/logger.go @@ -75,7 +75,7 @@ func New(config ...Config) fiber.Handler { // Set error handler once once.Do(func() { - // get longested possible path + // get longest possible path stack := c.App().Stack() for m := range stack { for r := range stack[m] { From e8e354756f3e70ddc7b9e08d3e917393f20fd6b2 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:57:46 -0400 Subject: [PATCH 19/34] spelling: nonexistent Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- middleware/session/data_test.go | 14 +++++++------- middleware/session/store_test.go | 4 ++-- middleware/static/static_test.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/middleware/session/data_test.go b/middleware/session/data_test.go index 1913f761d3b..0551eb64c4c 100644 --- a/middleware/session/data_test.go +++ b/middleware/session/data_test.go @@ -140,14 +140,14 @@ func TestData_Len(t *testing.T) { func TestData_Get(t *testing.T) { t.Parallel() - // Test case: Non-existent key - t.Run("Non-existent key", func(t *testing.T) { + // Test case: Nonexistent key + t.Run("Nonexistent key", func(t *testing.T) { t.Parallel() d := acquireData() defer dataPool.Put(d) defer d.Reset() - value := d.Get("non-existent-key") - require.Nil(t, value, "Expected nil for non-existent key") + value := d.Get("nonexistent-key") + require.Nil(t, value, "Expected nil for nonexistent key") }) // Test case: Existing key @@ -192,13 +192,13 @@ func TestData_Delete(t *testing.T) { require.Nil(t, value, "Expected nil for deleted key") }) - // Test case: Delete non-existent key - t.Run("Delete non-existent key", func(t *testing.T) { + // Test case: Delete nonexistent key + t.Run("Delete nonexistent key", func(t *testing.T) { t.Parallel() d := acquireData() defer dataPool.Put(d) defer d.Reset() - d.Delete("non-existent-key") + d.Delete("nonexistent-key") // No assertion needed, just ensure no panic or error }) } diff --git a/middleware/session/store_test.go b/middleware/session/store_test.go index 87ef25645b3..24428d56510 100644 --- a/middleware/session/store_test.go +++ b/middleware/session/store_test.go @@ -176,9 +176,9 @@ func Test_Store_GetByID(t *testing.T) { require.Equal(t, ErrEmptySessionID, err) }) - t.Run("non-existent session ID", func(t *testing.T) { + t.Run("nonexistent session ID", func(t *testing.T) { t.Parallel() - sess, err := store.GetByID(context.Background(), "non-existent-session-id") + sess, err := store.GetByID(context.Background(), "nonexistent-session-id") require.Error(t, err) require.Nil(t, sess) require.Equal(t, ErrSessionIDNotFoundInStore, err) diff --git a/middleware/static/static_test.go b/middleware/static/static_test.go index 068037f9955..d81dabd960d 100644 --- a/middleware/static/static_test.go +++ b/middleware/static/static_test.go @@ -1097,7 +1097,7 @@ func Test_Static_PathTraversal_WindowsOnly(t *testing.T) { // Attempt that includes a null-byte on Windows assertTraversalBlocked("/index.html%00.txt") - // Check behavior on an obviously non-existent and suspicious file + // Check behavior on an obviously nonexistent and suspicious file assertTraversalBlocked("/\\this\\path\\does\\not\\exist\\..") // Attempts involving relative traversal and current directory reference From ae87258c0175d88e4828c7046252ae480c489b4c Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:55:01 -0400 Subject: [PATCH 20/34] spelling: or fall back Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- docs/extra/internal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/extra/internal.md b/docs/extra/internal.md index 2bd310a4d00..8b2082c5286 100644 --- a/docs/extra/internal.md +++ b/docs/extra/internal.md @@ -265,7 +265,7 @@ Reusing Context objects significantly reduces garbage collection overhead, ensur ## Preforking Mechanism -To take full advantage of multi‑core systems, Fiber offers a prefork mode. In this mode, the master process spawns several child processes that listen on the same port using OS features such as SO_REUSEPORT (or a fallback to SO_REUSEADDR). +To take full advantage of multi‑core systems, Fiber offers a prefork mode. In this mode, the master process spawns several child processes that listen on the same port using OS features such as SO_REUSEPORT (or fall back to SO_REUSEADDR). ```mermaid flowchart LR From 12a52a699f60be62e77c2c2d25b0b2a88d4b6db6 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:50:08 -0400 Subject: [PATCH 21/34] spelling: otherwise, Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- AGENTS.md | 2 +- app.go | 6 +++--- docs/api/app.md | 4 ++-- middleware/limiter/limiter_sliding.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 54eb6c60c03..24a89a1870b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ ## 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. --- diff --git a/app.go b/app.go index aa21781ca67..ba00a6c2b83 100644 --- a/app.go +++ b/app.go @@ -637,7 +637,7 @@ func NewWithCustomCtx(newCtxFunc func(app *App) CustomCtx, config ...Config) *Ap } // GetString returns s unchanged when Immutable is off or s is read-only (rodata). -// Otherwise it returns a detached copy (strings.Clone). +// Otherwise, it returns a detached copy (strings.Clone). func (app *App) GetString(s string) string { if !app.config.Immutable || len(s) == 0 { return s @@ -649,7 +649,7 @@ func (app *App) GetString(s string) string { } // GetBytes returns b unchanged when Immutable is off or b is read-only (rodata). -// Otherwise it returns a detached copy. +// Otherwise, it returns a detached copy. func (app *App) GetBytes(b []byte) []byte { if !app.config.Immutable || len(b) == 0 { return b @@ -1263,7 +1263,7 @@ func (app *App) init() *App { // ErrorHandler is the application's method in charge of finding the // appropriate handler for the given request. It searches any mounted // sub fibers by their prefixes and if it finds a match, it uses that -// error handler. Otherwise it uses the configured error handler for +// error handler. Otherwise, it uses the configured error handler for // the app, which if not set is the DefaultErrorHandler. func (app *App) ErrorHandler(ctx Ctx, err error) error { var ( diff --git a/docs/api/app.md b/docs/api/app.md index ec822a122b2..ad5c849ac72 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -11,7 +11,7 @@ import Reference from '@site/src/components/reference'; ### GetString -Returns `s` unchanged when [`Immutable`](./fiber.md#immutable) is disabled or `s` resides in read-only memory. Otherwise it returns a detached copy using `strings.Clone`. +Returns `s` unchanged when [`Immutable`](./fiber.md#immutable) is disabled or `s` resides in read-only memory. Otherwise, it returns a detached copy using `strings.Clone`. ```go title="Signature" func (app *App) GetString(s string) string @@ -19,7 +19,7 @@ func (app *App) GetString(s string) string ### GetBytes -Returns `b` unchanged when [`Immutable`](./fiber.md#immutable) is disabled or `b` resides in read-only memory. Otherwise it returns a detached copy. +Returns `b` unchanged when [`Immutable`](./fiber.md#immutable) is disabled or `b` resides in read-only memory. Otherwise, it returns a detached copy. ```go title="Signature" func (app *App) GetBytes(b []byte) []byte diff --git a/middleware/limiter/limiter_sliding.go b/middleware/limiter/limiter_sliding.go index 08f3ef12f56..77833bae012 100644 --- a/middleware/limiter/limiter_sliding.go +++ b/middleware/limiter/limiter_sliding.go @@ -100,7 +100,7 @@ func (SlidingWindow) New(cfg Config) fiber.Handler { // duration + expiration = end of next window. // Because we don't want to garbage collect in the middle of a window // we add the expiration to the duration. - // Otherwise after the end of "sample window", attackers could launch + // Otherwise, after the end of "sample window", attackers could launch // a new request with the full window length. if setErr := manager.set(c, key, e, time.Duration(resetInSec+expiration)*time.Second); setErr != nil { //nolint:gosec // Not a concern mux.Unlock() From de3d9ce9c1ba1ac9332b70f58361891c206318f8 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 23:49:49 -0400 Subject: [PATCH 22/34] spelling: partial Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- path_testcases_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/path_testcases_test.go b/path_testcases_test.go index 343533be81c..593363c6219 100644 --- a/path_testcases_test.go +++ b/path_testcases_test.go @@ -350,7 +350,7 @@ func init() { {url: "/partialCheck/foo/bar/test", params: []string{"test"}, match: true, partialCheck: true}, {url: "/partialCheck/foo/bar/test/test2", params: []string{"test"}, match: true, partialCheck: true}, {url: "/partialCheck/foo/bar", params: nil, match: false, partialCheck: true}, - {url: "/partiaFoo", params: nil, match: false, partialCheck: true}, + {url: "/partialFoo", params: nil, match: false, partialCheck: true}, }, }, { From 346409478fdb12361e0963deacea24259b4fbec7 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 23:53:30 -0400 Subject: [PATCH 23/34] spelling: pre-shutdown Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- hooks_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks_test.go b/hooks_test.go index 32e5b874a68..9f2983c71a3 100644 --- a/hooks_test.go +++ b/hooks_test.go @@ -186,14 +186,14 @@ func Test_Hook_OnPrehutdown(t *testing.T) { defer bytebufferpool.Put(buf) app.Hooks().OnPreShutdown(func() error { - _, err := buf.WriteString("pre-shutdowning") + _, err := buf.WriteString("pre-shutdown") require.NoError(t, err) return nil }) require.NoError(t, app.Shutdown()) - require.Equal(t, "pre-shutdowning", buf.String()) + require.Equal(t, "pre-shutdown", buf.String()) } func Test_Hook_OnPostShutdown(t *testing.T) { From 7e0a5e911bdb52e853184cde2a549124eb7945ae Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:50:17 -0400 Subject: [PATCH 24/34] spelling: prepopulate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- state_test.go | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/state_test.go b/state_test.go index dd703ed50c3..c4544ec63a4 100644 --- a/state_test.go +++ b/state_test.go @@ -743,7 +743,7 @@ func BenchmarkState_Get(b *testing.B) { st := newState() n := 1000 - // pre-populate the state + // prepopulate the state for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, i) @@ -762,7 +762,7 @@ func BenchmarkState_GetString(b *testing.B) { st := newState() n := 1000 - // pre-populate the state + // prepopulate the state for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, strconv.Itoa(i)) @@ -781,7 +781,7 @@ func BenchmarkState_GetInt(b *testing.B) { st := newState() n := 1000 - // pre-populate the state + // prepopulate the state for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, i) @@ -800,7 +800,7 @@ func BenchmarkState_GetBool(b *testing.B) { st := newState() n := 1000 - // pre-populate the state + // prepopulate the state for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, i%2 == 0) @@ -819,7 +819,7 @@ func BenchmarkState_GetFloat64(b *testing.B) { st := newState() n := 1000 - // pre-populate the state + // prepopulate the state for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, float64(i)) @@ -838,7 +838,7 @@ func BenchmarkState_MustGet(b *testing.B) { st := newState() n := 1000 - // pre-populate the state + // prepopulate the state for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, i) @@ -857,7 +857,7 @@ func BenchmarkState_GetStateGeneric(b *testing.B) { st := newState() n := 1000 - // pre-populate the state + // prepopulate the state for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, i) @@ -876,7 +876,7 @@ func BenchmarkState_MustGetStateGeneric(b *testing.B) { st := newState() n := 1000 - // pre-populate the state + // prepopulate the state for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, i) @@ -895,7 +895,7 @@ func BenchmarkState_GetStateWithDefault(b *testing.B) { st := newState() n := 1000 - // pre-populate the state + // prepopulate the state for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, i) @@ -914,7 +914,7 @@ func BenchmarkState_Has(b *testing.B) { st := newState() n := 1000 - // pre-populate the state + // prepopulate the state for i := range n { st.Set("key"+strconv.Itoa(i), i) } @@ -981,7 +981,7 @@ func BenchmarkState_GetUint(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with uint values. + // Prepopulate the state with uint values. for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, uint(i)) //nolint:gosec // This is a test @@ -998,7 +998,7 @@ func BenchmarkState_GetInt8(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with int8 values (using modulo to stay in range). + // Prepopulate the state with int8 values (using modulo to stay in range). for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, int8(i%128)) //nolint:gosec // This is a test @@ -1015,7 +1015,7 @@ func BenchmarkState_GetInt16(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with int16 values. + // Prepopulate the state with int16 values. for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, int16(i)) //nolint:gosec // This is a test @@ -1032,7 +1032,7 @@ func BenchmarkState_GetInt32(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with int32 values. + // Prepopulate the state with int32 values. for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, int32(i)) //nolint:gosec // This is a test @@ -1049,7 +1049,7 @@ func BenchmarkState_GetInt64(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with int64 values. + // Prepopulate the state with int64 values. for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, int64(i)) @@ -1066,7 +1066,7 @@ func BenchmarkState_GetUint8(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with uint8 values. + // Prepopulate the state with uint8 values. for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, uint8(i%256)) //nolint:gosec // This is a test @@ -1083,7 +1083,7 @@ func BenchmarkState_GetUint16(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with uint16 values. + // Prepopulate the state with uint16 values. for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, uint16(i)) //nolint:gosec // This is a test @@ -1100,7 +1100,7 @@ func BenchmarkState_GetUint32(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with uint32 values. + // Prepopulate the state with uint32 values. for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, uint32(i)) //nolint:gosec // This is a test @@ -1117,7 +1117,7 @@ func BenchmarkState_GetUint64(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with uint64 values. + // Prepopulate the state with uint64 values. for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, uint64(i)) //nolint:gosec // This is a test @@ -1134,7 +1134,7 @@ func BenchmarkState_GetUintptr(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with uintptr values. + // Prepopulate the state with uintptr values. for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, uintptr(i)) @@ -1151,7 +1151,7 @@ func BenchmarkState_GetFloat32(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with float32 values. + // Prepopulate the state with float32 values. for i := range n { key := "key" + strconv.Itoa(i) st.Set(key, float32(i)) @@ -1168,7 +1168,7 @@ func BenchmarkState_GetComplex64(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with complex64 values. + // Prepopulate the state with complex64 values. for i := range n { key := "key" + strconv.Itoa(i) // Create a complex64 value with both real and imaginary parts. @@ -1186,7 +1186,7 @@ func BenchmarkState_GetComplex128(b *testing.B) { b.ReportAllocs() st := newState() n := 1000 - // Pre-populate the state with complex128 values. + // Prepopulate the state with complex128 values. for i := range n { key := "key" + strconv.Itoa(i) // Create a complex128 value with both real and imaginary parts. From 41f6a994062f8d95ecf143366f015ff2c63d9785 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 23:51:50 -0400 Subject: [PATCH 25/34] spelling: preshutdown Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- hooks_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks_test.go b/hooks_test.go index 9f2983c71a3..0edb3b3e14d 100644 --- a/hooks_test.go +++ b/hooks_test.go @@ -178,7 +178,7 @@ func Test_Hook_OnGroupName_Error(t *testing.T) { }) } -func Test_Hook_OnPrehutdown(t *testing.T) { +func Test_Hook_OnPreShutdown(t *testing.T) { t.Parallel() app := New() From ae45770a77d33694565c7cba8537fcc76f000b73 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 23:52:44 -0400 Subject: [PATCH 26/34] spelling: repeated Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- middleware/idempotency/locker_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/idempotency/locker_test.go b/middleware/idempotency/locker_test.go index 8dc75963da4..eea0353b7d0 100644 --- a/middleware/idempotency/locker_test.go +++ b/middleware/idempotency/locker_test.go @@ -114,7 +114,7 @@ func Benchmark_MemoryLock_Parallel(b *testing.B) { b.ResetTimer() b.RunParallel(func(p *testing.PB) { for p.Next() { - // Division by 3 ensures that index will be repreated exactly 3 times + // Division by 3 ensures that index will be repeated exactly 3 times i := int(keyI.Add(1)) / 3 % len(keys) key := keys[i] if err := lock.Lock(key); err != nil { From d228ad8ff70c6309d6efcd8ab61bb2ea5b18b485 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 21:48:01 -0400 Subject: [PATCH 27/34] spelling: set up Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- middleware/csrf/csrf_test.go | 2 +- middleware/keyauth/keyauth_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/middleware/csrf/csrf_test.go b/middleware/csrf/csrf_test.go index 729fcd218c4..6ad057405bc 100644 --- a/middleware/csrf/csrf_test.go +++ b/middleware/csrf/csrf_test.go @@ -2149,7 +2149,7 @@ func Test_CSRF_Extractors_ErrorTypes(t *testing.T) { app := fiber.New() requestCtx := &fasthttp.RequestCtx{} - tc.setupCtx(requestCtx) // Setup the context properly + tc.setupCtx(requestCtx) // Set up the context properly ctx := app.AcquireCtx(requestCtx) defer app.ReleaseCtx(ctx) diff --git a/middleware/keyauth/keyauth_test.go b/middleware/keyauth/keyauth_test.go index 31090d403c0..fc26c4d5e40 100644 --- a/middleware/keyauth/keyauth_test.go +++ b/middleware/keyauth/keyauth_test.go @@ -196,7 +196,7 @@ func TestMultipleKeyLookup(t *testing.T) { scheme = "Bearer" ) - // setup the fiber endpoint + // set up the fiber endpoint app := fiber.New() customExtractor := extractors.Chain( @@ -256,10 +256,10 @@ func TestMultipleKeyLookup(t *testing.T) { } func Test_MultipleKeyAuth(t *testing.T) { - // setup the fiber endpoint + // set up the fiber endpoint app := fiber.New() - // setup keyauth for /auth1 + // set up keyauth for /auth1 app.Use(New(Config{ Next: func(c fiber.Ctx) bool { return c.Path() != "/auth1" From 00f42595f6958e7d056a9c018281fdd30fd58c2f Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 20 Oct 2025 23:52:58 -0400 Subject: [PATCH 28/34] spelling: soccer Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- bind_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bind_test.go b/bind_test.go index ffa99e89c8b..e42f74ac478 100644 --- a/bind_test.go +++ b/bind_test.go @@ -72,7 +72,7 @@ func Test_Bind_Query(t *testing.T) { require.NoError(t, c.Bind().Query(q)) require.Len(t, q.Hobby, 2) - c.Request().URI().SetQueryString("id=1&name=tom&hobby=scoccer&hobby=basketball,football") + c.Request().URI().SetQueryString("id=1&name=tom&hobby=soccer&hobby=basketball,football") q = new(Query) require.NoError(t, c.Bind().Query(q)) require.Len(t, q.Hobby, 3) @@ -148,12 +148,12 @@ func Test_Bind_Query_Map(t *testing.T) { require.NoError(t, c.Bind().Query(&q)) require.Len(t, q["hobby"], 2) - c.Request().URI().SetQueryString("id=1&name=tom&hobby=scoccer&hobby=basketball,football") + c.Request().URI().SetQueryString("id=1&name=tom&hobby=soccer&hobby=basketball,football") q = make(map[string][]string) require.NoError(t, c.Bind().Query(&q)) require.Len(t, q["hobby"], 3) - c.Request().URI().SetQueryString("id=1&name=tom&hobby=scoccer") + c.Request().URI().SetQueryString("id=1&name=tom&hobby=soccer") qq := make(map[string]string) require.NoError(t, c.Bind().Query(&qq)) require.Equal(t, "1", qq["id"]) From c42a544089790aa54da80fc61cbe1f886196f3f3 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 21 Oct 2025 08:07:14 -0400 Subject: [PATCH 29/34] spelling: spoofing if your app is behind a Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- ctx_interface_gen.go | 8 ++++---- req.go | 8 ++++---- req_interface_gen.go | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ctx_interface_gen.go b/ctx_interface_gen.go index 8da451c07f2..3d7e35859c7 100644 --- a/ctx_interface_gen.go +++ b/ctx_interface_gen.go @@ -214,19 +214,19 @@ type Ctx interface { // while `Hostname` refers specifically to the name assigned to a device on a network, excluding any port information. // Example: URL: https://example.com:8080 -> Host: example.com:8080 // Make copies or use the Immutable setting instead. - // Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. + // Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. Host() string // Hostname contains the hostname derived from the X-Forwarded-Host or Host HTTP header using the c.Host() method. // Returned value is only valid within the handler. Do not store any references. // Example: URL: https://example.com:8080 -> Hostname: example.com // Make copies or use the Immutable setting instead. - // Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. + // Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. Hostname() string // Port returns the remote port of the request. Port() string // IP returns the remote IP address of the request. // If ProxyHeader and IP Validation is configured, it will parse that header and return the first valid IP address. - // Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. + // Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. IP() string // extractIPsFromHeader will return a slice of IPs it found given a header name in the order they appear. // When IP validation is enabled, any invalid IPs will be omitted. @@ -263,7 +263,7 @@ type Ctx interface { // Make copies or use the Immutable setting to use the value outside the Handler. Params(key string, defaultValue ...string) string // Scheme contains the request protocol string: http or https for TLS requests. - // Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. + // Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. Scheme() string // Protocol returns the HTTP protocol of request: HTTP/1.1 and HTTP/2. Protocol() string diff --git a/req.go b/req.go index ff2c21864d0..9084b03222e 100644 --- a/req.go +++ b/req.go @@ -317,7 +317,7 @@ func (r *DefaultReq) GetHeaders() map[string][]string { // while `Hostname` refers specifically to the name assigned to a device on a network, excluding any port information. // Example: URL: https://example.com:8080 -> Host: example.com:8080 // Make copies or use the Immutable setting instead. -// Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. +// Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. func (r *DefaultReq) Host() string { if r.IsProxyTrusted() { if host := r.Get(HeaderXForwardedHost); len(host) > 0 { @@ -335,7 +335,7 @@ func (r *DefaultReq) Host() string { // Returned value is only valid within the handler. Do not store any references. // Example: URL: https://example.com:8080 -> Hostname: example.com // Make copies or use the Immutable setting instead. -// Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. +// Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. func (r *DefaultReq) Hostname() string { addr, _ := parseAddr(r.Host()) @@ -353,7 +353,7 @@ func (r *DefaultReq) Port() string { // IP returns the remote IP address of the request. // If ProxyHeader and IP Validation is configured, it will parse that header and return the first valid IP address. -// Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. +// Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. func (r *DefaultReq) IP() string { app := r.c.app if r.IsProxyTrusted() && len(app.config.ProxyHeader) > 0 { @@ -625,7 +625,7 @@ func Params[V GenericType](c Ctx, key string, defaultValue ...V) V { } // Scheme contains the request protocol string: http or https for TLS requests. -// Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. +// Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. func (r *DefaultReq) Scheme() string { ctx := r.c.fasthttp if ctx.IsTLS() { diff --git a/req_interface_gen.go b/req_interface_gen.go index 5f854115d63..1ecd257951c 100644 --- a/req_interface_gen.go +++ b/req_interface_gen.go @@ -81,19 +81,19 @@ type Req interface { // while `Hostname` refers specifically to the name assigned to a device on a network, excluding any port information. // Example: URL: https://example.com:8080 -> Host: example.com:8080 // Make copies or use the Immutable setting instead. - // Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. + // Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. Host() string // Hostname contains the hostname derived from the X-Forwarded-Host or Host HTTP header using the c.Host() method. // Returned value is only valid within the handler. Do not store any references. // Example: URL: https://example.com:8080 -> Hostname: example.com // Make copies or use the Immutable setting instead. - // Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. + // Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. Hostname() string // Port returns the remote port of the request. Port() string // IP returns the remote IP address of the request. // If ProxyHeader and IP Validation is configured, it will parse that header and return the first valid IP address. - // Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. + // Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. IP() string // extractIPsFromHeader will return a slice of IPs it found given a header name in the order they appear. // When IP validation is enabled, any invalid IPs will be omitted. @@ -134,7 +134,7 @@ type Req interface { // Make copies or use the Immutable setting to use the value outside the Handler. Params(key string, defaultValue ...string) string // Scheme contains the request protocol string: http or https for TLS requests. - // Please use Config.TrustProxy to prevent header spoofing, in case when your app is behind the proxy. + // Please use Config.TrustProxy to prevent header spoofing if your app is behind a proxy. Scheme() string // Protocol returns the HTTP protocol of request: HTTP/1.1 and HTTP/2. Protocol() string From 14f5513d27fe846faf01f15417b831e2950e3208 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 21 Oct 2025 12:42:57 -0400 Subject: [PATCH 30/34] spelling: sub-origins Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- middleware/cors/cors.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/middleware/cors/cors.go b/middleware/cors/cors.go index 708fd069f99..e84edf211b6 100644 --- a/middleware/cors/cors.go +++ b/middleware/cors/cors.go @@ -44,7 +44,7 @@ func New(config ...Config) fiber.Handler { // allowOrigins is a slice of strings that contains the allowed origins // defined in the 'AllowOrigins' configuration. allowOrigins := []string{} - allowSOrigins := []subdomain{} + allowSubOrigins := []subdomain{} // Validate and normalize static AllowOrigins allowAllOrigins := len(cfg.AllowOrigins) == 0 && cfg.AllowOriginsFunc == nil @@ -63,7 +63,7 @@ func New(config ...Config) fiber.Handler { } schemeSep := strings.Index(normalizedOrigin, "://") + len("://") sd := subdomain{prefix: normalizedOrigin[:schemeSep], suffix: normalizedOrigin[schemeSep:]} - allowSOrigins = append(allowSOrigins, sd) + allowSubOrigins = append(allowSubOrigins, sd) } else { isValid, normalizedOrigin := normalizeOrigin(trimmedOrigin) if !isValid { @@ -132,7 +132,7 @@ func New(config ...Config) fiber.Handler { // Check if the origin is in the list of allowed subdomains if allowOrigin == "" { - for _, sOrigin := range allowSOrigins { + for _, sOrigin := range allowSubOrigins { if sOrigin.match(originHeader) { allowOrigin = originHeaderRaw break From a05398ccbdb0dc07e1ee3a75ec8055b6da7a4013 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 21 Oct 2025 13:28:31 -0400 Subject: [PATCH 31/34] spelling: there is Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- bind.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bind.go b/bind.go index 27493a28585..34dab5c992e 100644 --- a/bind.go +++ b/bind.go @@ -299,7 +299,7 @@ func (b *Bind) MsgPack(out any) error { // It supports decoding the following content types based on the Content-Type header: // application/json, application/xml, application/x-www-form-urlencoded, multipart/form-data // If none of the content types above are matched, it'll take a look custom binders by checking the MIMETypes() method of custom binder. -// If there're no custom binder for mime type of body, it will return a ErrUnprocessableEntity error. +// If there is no custom binder for mime type of body, it will return a ErrUnprocessableEntity error. func (b *Bind) Body(out any) error { // Get content-type ctype := utils.ToLower(utils.UnsafeString(b.ctx.RequestCtx().Request.Header.ContentType())) From 906ab27a184df78370890e64f2d65ecb81727f31 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:08:11 -0400 Subject: [PATCH 32/34] spelling: when Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- mount_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mount_test.go b/mount_test.go index 0870910945d..2c3878165b2 100644 --- a/mount_test.go +++ b/mount_test.go @@ -167,7 +167,7 @@ func Test_App_Mount_RoutePositions(t *testing.T) { return c.SendString("ok") }) app.Use(func(c Ctx) error { - // is overwritten in case the positioning is not correct + // is overwritten when the positioning is not correct c.Locals("world", "hello") return c.Next() }) From 7e70ca2a81ad472b84e0a4791bb1f9b3a0d55ac9 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:28:07 -0400 Subject: [PATCH 33/34] reword: when neither/nor... Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- path.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/path.go b/path.go index adb6d70e517..afa3d81c1bd 100644 --- a/path.go +++ b/path.go @@ -263,8 +263,8 @@ func addParameterMetaInfo(segs []*routeSegment) []*routeSegment { for i := range segLen { // check how often the compare part is in the following const parts if segs[i].IsParam { - // check if parameter segments are directly after each other and if one of them is greedy - // in case the next parameter or the current parameter is not a wildcard it's not greedy, we only want one character + // check if parameter segments are directly after each other; + // when neither this parameter nor the next parameter are greedy, we only want one character if segLen > i+1 && !segs[i].IsGreedy && segs[i+1].IsParam && !segs[i+1].IsGreedy { segs[i].Length = 1 } From cb5c28e770c875cacad6498e2c83ce4594ab3f4d Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 21 Oct 2025 17:24:07 -0400 Subject: [PATCH 34/34] spelling: sometimes, the id is not equal to a Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- middleware/cache/cache_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/cache/cache_test.go b/middleware/cache/cache_test.go index 7176fcb34f4..d5430422c38 100644 --- a/middleware/cache/cache_test.go +++ b/middleware/cache/cache_test.go @@ -533,7 +533,7 @@ func Test_Cache_WithSeveralRequests(t *testing.T) { a, err := strconv.Atoi(string(idFromServ)) require.NoError(t, err) - // SomeTimes,The id is not equal with a + // Sometimes, the id is not equal to a require.Equal(t, id, a) }(i) }