72 Commits

Author SHA1 Message Date
Juan Calderon-Perez
40e1e76a1c
📒 docs: Improve Timeout middleware documentation (#3675)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-11 12:28:18 +02:00
Juan Calderon-Perez
fcd66f5a71
🔥 feat: Add KeepConnectionHeader option to Proxy middleware (#3662)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-06 17:05:43 +02:00
Juan Calderon-Perez
9674101c61
📒docs: Fix KeyAuth middleware docs (#3641)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-04 10:13:15 +02:00
Juan Calderon-Perez
67a2166788
📒 docs: Fix Healthcheck middleware documentation (#3657)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-04 09:13:54 +02:00
Juan Calderon-Perez
a838dfbf9a
🧹 chore: Fix CSRF error message mismatch with documentation (#3636) 2025-08-01 16:57:52 +02:00
Juan Calderon-Perez
28eabcb83a
🧹 chore: Fix CORS docs and comments (#3637)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-01 16:55:13 +02:00
Juan Calderon-Perez
ceacde5ca4
🧹 chore: Remove support for PasswordFromContext from BasicAuth middleware (#3638) 2025-08-01 12:48:42 +02:00
Juan Calderon-Perez
e8345f92a6
📒docs: Fix pprof middleware docs and default config (#3642) 2025-08-01 12:46:25 +02:00
Juan Calderon-Perez
9c2c23881d
📒docs: Fix Static middleware docs (#3643) 2025-08-01 12:44:16 +02:00
Juan Calderon-Perez
6bf3df4cd1
📒docs: Fix Favicon middleware documentation (#3640)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-08-01 12:43:35 +02:00
Juan Calderon-Perez
ab34d1d70a
📒docs: Fix Cache middleware docs (#3644) 2025-08-01 12:43:04 +02:00
Juan Calderon-Perez
c01bcca593
📒docs: Fix Compress middleware docs (#3645) 2025-08-01 12:42:29 +02:00
Juan Calderon-Perez
c2da03a276
📒docs: Fix Proxy middleware docs (#3647) 2025-08-01 12:42:00 +02:00
Juan Calderon-Perez
18d994eb11
📒docs: Fix RequestID docs (#3648) 2025-08-01 12:41:32 +02:00
Juan Calderon-Perez
8770286e0a
📒docs: Fix Skip middleware docs (#3649) 2025-08-01 08:43:34 +02:00
Juan Calderon-Perez
4882721546
📒docs: Fix EarlyData middleware docs (#3646) 2025-08-01 08:43:09 +02:00
Juan Calderon-Perez
c309d46c3a
🧹 chore: Remove SHA-1/MD5 support in BasicAuth middleware (#3634)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-30 15:58:00 +02:00
Juan Calderon-Perez
2e544aecab
🔥 feat: Support hashed BasicAuth passwords (#3631) 2025-07-30 08:45:09 +02:00
Jason McNeil
1d9eca383c
feat(csrf): Enhance extractor functionality with metadata and security validation (#3630) 2025-07-30 08:40:56 +02:00
Jason McNeil
979e7cd6b1
feat(middleware/session): Introduce Extractor pattern for session ID retrieval (#3625)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-07-28 16:48:22 +02:00
Juan Calderon-Perez
b839032cf2
🔥 feat: Add HeaderLimit option to BasicAuth middleware (#3620)
Co-authored-by: RW <rene@gofiber.io>
2025-07-27 16:56:15 +02:00
Juan Calderon-Perez
96674dc591
🔥 feat: Add Fiber Context to BasicAuth Authorizer (#3621) 2025-07-27 16:25:31 +02:00
Juan Calderon-Perez
56b5e6bb76
🔥 feat: Support for disabling response headers in Limiter Middleware (#3618) 2025-07-25 14:38:41 +02:00
RW
05f8ac0255
🔥 feat: Add config for Timeout middleware (#3604)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-20 15:22:08 +02:00
Jason McNeil
e17bab7946
Refactor CSRF middleware and enhance documentation (#3598)
Co-authored-by: RW <rene@gofiber.io>
2025-07-19 20:11:33 +02:00
Juan Calderon-Perez
d79fa01f0f
🐛 bug: Fix Content-Disposition header per RFC 6266 (#3551)
* Use raw UTF-8 filenames in Content-Disposition

* Fix lint issues

* Fix issue with new funct

* Improve and fix quoteRawString

* fix issues

* Fix lint issues

* fix golangci-lint

* Update static_test.go

* Update static_test.go
2025-06-30 09:06:11 +02:00
Juan Calderon-Perez
bdd9e22bd7
🐛 bug: Fix Cache middleware handling of Age (#3547)
* Revert benchmark loop changes

* test: cover Age header parsing

* generate msgp files

* Update cache.go

* Cast result

* Update cache.go
2025-06-30 09:04:35 +02:00
Juan Calderon-Perez
30bb809255
🐛 bug: Fix Etag validation per RFC 9110 (#3554)
* Add strong ETag comparison helper

* Review fixes

* update normalizeEtag

* cleanup new tests, add more cases.

* lint

* name param

* more fixes

* more fixes

* add missing param

* fix funct name

* string not bytes

* format is correct

* fix lint?

* enable debug output for linter

* Fix linter issue
2025-06-30 08:52:01 +02:00
Juan Calderon-Perez
6d16bf5605
🧹chore: Improve BasicAuth middleware default security (#3522)
* Refine BasicAuth middleware

* Fix lint issues

* Update basicauth.md
2025-06-20 08:47:35 +02:00
Jason McNeil
670fbd5e45
feat: Add support for Keys() in session middleware (#3517)
*  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
2025-06-13 11:40:17 +02:00
Jason McNeil
73e919621b
📒 docs: Enhance CORS middleware documentation with preflight request details and infrastructure considerations (#3509)
* docs: Enhance CORS middleware documentation with preflight request details and infrastructure considerations

* docs: Update CORS middleware documentation with infrastructure handling options and best practices

* docs: fix CORS middleware documentation markdown linting issues
2025-06-10 08:46:19 +02:00
Juan Calderon-Perez
3a60cf7a4e
🧹 chore: Refactor EnvVar middleware (#3513)
* remove ExcludeVars option

* Simplify envvar export logic
2025-06-10 08:40:58 +02:00
Juan Calderon-Perez
80f4f99c01
🧹 chore: Fix typos in code and docs (#3507)
chore: fix spelling mistakes across codebase
2025-06-07 22:34:44 +02:00
RW
9409e4ff0c
📒 docs: Remove deprecated comments and documenting recent changes (#3498)
* removing deprecated comments and documenting the changes in the whats new overview

* removing deprecated comments and documenting the changes in the whats new overview
2025-06-04 08:20:00 +02:00
Juan Calderon-Perez
47f47ae2d8
🧹 chore: Enhance BasicAuth middleware to better comply with RFC 6750 (#3484)
* test(basicauth): ensure whitespace tolerant

* use utils.TrimSpace

* Update docs
2025-05-27 14:27:45 +02:00
Juan Calderon-Perez
804a2b923e
🧹 chore: Enhance KeyAuth middleware to better comply with RFC 6750 (#3482)
* docs(keyauth): add Realm option

* Add unit-test for GenericError case

* Update keyauth_test.go

* Backport fixes

* Update keyauth_test.go

* Fix spacing

* Add test for empty value

* Remove extra comma

* Add missing closing brace

* Review comments

* add missing import

* Add more unit-tests

* remove inconclusive test
2025-05-27 14:07:42 +02:00
RW
aae8892c7e
Improve proxy middleware (#3468) 2025-05-23 10:47:05 +02:00
Jason McNeil
4aae3271af
📝 docs: Document usage of Custom Tags in Logger middleware (#3446)
* 📝 docs: Update logger middleware documentation to include CustomTags for logging Request ID

* 📚 docs: fix markdown lint errors
2025-05-13 08:42:46 +02:00
RW
ab7f949382
📒 docs: Idempotency add more detailed description for next method (#3443)
* add more detailed description for next method
2025-05-12 14:59:42 +02:00
Isaac Andrade
4321dfed55
♻️ refactor: Change c.Redirect() default status (#3415)
* 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>
2025-05-12 14:56:23 +02:00
Yorick de Wid
057647a579
🔥 feat: Add support for ForceColors in Logger middleware (#3428)
* 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'
2025-05-09 13:58:41 +02:00
AuroraTea
2ef852e1a9
📚 Doc: Fix examples in middleware/session (#3435)
📚 Doc: Fix example in middleware/session
2025-05-06 08:33:12 +02:00
Jason McNeil
6eba33af25
📒 docs: fix CSRF handler example (#3412)
docs(middleware/csrf): fix handler example
2025-04-15 08:03:30 +02:00
Jason McNeil
b3e84860d2
Revert "🔥 feat: Add Context Support to RequestID Middleware" (#3365)
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>
2025-04-08 08:59:24 +02:00
Juan Calderon-Perez
75281bd874
🧹 chore: Simplify HealthCheck middleware (#3380)
* Simplify middleware

* Rename default endpoints
2025-03-30 11:46:52 +02:00
Edvard
e947e03ed2
🔥 feat(logger): Add predefined log formats (#3359)
* 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>
2025-03-21 16:13:21 +01:00
Juan Calderon-Perez
b56a141d59
docs: Update helmet.md default values (#3350)
Update helmet.md
2025-03-14 07:51:34 +01:00
JIeJaitt
c0599ee1d4
🔥 feat: Add Skip function to logger middleware (#3333)
* 🔥 Feature(logger): Add Filter option to logger middleware

* 📚 Doc(logger): Clarify Filter middleware description

* 🚨 Test(logger): Enhance logger filter test with parallel subtests

* 🔒 Test(logger): Add mutex to prevent race conditions in logger test

* 🔥 Feature(logger): Add Filter option to logger middleware

* 📚 Doc(logger): Clarify Filter middleware description

* 🚨 Test(logger): Enhance logger filter test with parallel subtests

* 🔒 Test(logger): Add mutex to prevent race conditions in logger test

* 🚨 Test(logger): Refactor logger test to improve test isolation

* Fix issue with unit-tests

* Update middleware/logger/logger_test.go

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Apply logger filter as soon as possible

* 📚 Doc: Add logger filter configuration example to whats_new.md

* 📚 Doc: Update logger filter documentation in whats_new.md

* 📚 Doc: Update logger filter documentation and examples

* 🩹 Fix: improve what_new.md

* Update logic for Filter() in Logger middleware. Add more unit-tests

* Rename fields to match expressjs/morgan

* Update middleware/logger/default_logger.go

---------

Co-authored-by: Juan Calderon-Perez <jgcalderonperez@protonmail.com>
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: RW <rene@gofiber.io>
2025-03-10 09:06:11 +01:00
René
d655e08a48 add more adpater documenation 2025-02-20 13:52:23 +01:00
René
cdb862add1 add more adpater documenation 2025-02-20 12:58:08 +01:00