* ✨ feat: Update session middleware add Keys method and update docs to match key type any
* ✨ test: Add /keys endpoint to set and retrieve multiple session keys
* ✨ test: Refactor /keys endpoint to trim whitespace and improve key handling in session tests
* chore: update docs and workflows for go1.24
* Fix listen bug
* Use b.Loop() for benchmarks https://go.dev/blog/testing-b-loop
* Use b.Loop() for benchmarks https://go.dev/blog/testing-b-loop
* Revert b.Loop() for some benchmarks
* Change genericParser benchmarks (runParallel)
* Change Benchmark_Router_Github_API benchmarks (runParallel)
* Set default redirect response status to 303 SeeOther
Closes#3405
In some browsers, redirect status 302 Found sometimes is used to change
the HTTP verb of the response from what the user set to what was used in
the request. Changing to 303 SeeOther in the default works more like
expected: it defaults to GET and can be overriden by the user.
* Add tests to Redirect default status change.
* Update docs.
* Fix remaining tests to reflect redirect 303 status as the new default. Reflect that in docs/whats_new.md
* Update redirect_test.go
* Fix code review hints
---------
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Co-authored-by: René <rene@gofiber.io>
* Force the use of terminal colors via config option
* docs: add example for forcing terminal colors in logger middleware
* test: add benchmarks for logger middleware with forced colors
* Add ForceColors field to 'whats new'
* Show example in 'whats new'
Revert "🔥 feat: Add Context Support to RequestID Middleware (#3200)"
This reverts commit f725ded92bac13e773f92ff478e1a461c160abd3.
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Revert "🔥 feat: Add support for context.Context in keyauth middleware (#3287)"
This reverts commit 4177ab4086a97648553f34bcff2ff81a137d31f3.
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
* feat(logger): Add predefined log formats
This commit introduces predefined log formats for the logger middleware, enhancing its flexibility and ease of use. Users can now specify formats like "common", "combined", and "json" in addition to the default format.
Changes:
- Added a `format.go` file to store predefined log format constants.
- Updated `config.go` to include documentation for the `Format` configuration option, explaining the available placeholders and predefined formats.
- Modified `logger.go` to utilize the predefined formats based on the `Format` configuration.
- Added a new test case `Test_Logger_CLF` in `logger_test.go` to verify the "common" log format.
* feat(logger): Use predefined formats and fix default format
This commit updates the logger middleware to utilize the predefined log formats introduced in a previous commit. It also fixes the default format to use the `FormatDefault` constant.
Changes:
- Updated `config.go` to use `FormatDefault` constant for the default format.
- Updated `default_logger.go` to use `FormatDefault` constant for the default format.
- Added new test cases in `logger_test.go` to verify the "common", "combined" and "json" log formats.
- Updated `format.go` to add newline character to the end of the default format.
* feat(logger): Document and exemplify predefined formats
* fix(logger): Improve test assertions based on golangci-lint
* docs(logger): Improve documentation and formatting logger.md based on markdownlint-cli2
* docs(logger): Improve documentation based on markdownlint-cli2
* fix(logger): Improve combined and JSON format tests
* feat(logger): Add ECS log format
* feat(logger): Add CustomFormat option
This commit introduces a `CustomFormat` option to the `Config` struct, allowing users to specify a predefined format (like "common", "combined", "json", or "ecs")
* feat(logger): Add ECS log format to examples and config
* docs(logger): Update examples in whats_new.md
* feat(logger): Remove CustomFormat option and renamed Format consts
- Removed `CustomFormat` field from `Config`.
- Removed `LoggerConfig` map.
- Rename predefined formats constants.
* docs(logger): Update documentation and examples after format refactor
---------
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
* feat(middleware): add support to context.Context in keyauth middleware
pretty straightforward option to use context.Context instead of just
fiber.Ctx, tests added accordingly.
* fix(middleware): include import that was missing from previous commit
* fix(middleware): include missing import
* Replace logger with panic
* Update keyauth_test.go
* Update keyauth_test.go
---------
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
* feat(timeout): unify and enhance timeout middleware
- Combine classic context-based timeout with a Goroutine + channel approach
- Support custom error list without additional parameters
- Return fiber.ErrRequestTimeout for timeouts or listed errors
* feat(timeout): unify and enhance timeout middleware
- Combine classic context-based timeout with a Goroutine + channel approach
- Support custom error list without additional parameters
- Return fiber.ErrRequestTimeout for timeouts or listed errors
* refactor(timeout): remove goroutine-based logic and improve documentation
- Switch to a synchronous approach to avoid data races with fasthttp context
- Enhance error handling for deadline and custom errors
- Update comments for clarity and maintainability
* refactor(timeout): add more test cases and handle zero duration case
* refactor(timeout): add more test cases and handle zero duration case
* refactor(timeout): add more test cases and handle zero duration case
---------
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>