1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-06 11:02:01 +00:00

4057 Commits

Author SHA1 Message Date
René
7af9c93f5b add internal architecture docs 2025-02-04 09:17:43 +01:00
René
f5b7a12d84 cleanup: remove unused function IndexRune 2025-01-30 16:50:20 +01:00
René
d0ed605194 fix docs sync bug 2025-01-29 08:30:11 +01:00
René
7dc28a0b45 increase node version for doc sync action 2025-01-29 08:23:24 +01:00
René
17634dab23 Merge remote-tracking branch 'origin/main' 2025-01-29 08:16:13 +01:00
René
4c09b32d14 fix docs for URI Binder 2025-01-29 08:16:03 +01:00
Juan Calderon-Perez
85041cdd77
Merge pull request #3295 from gofiber/dependabot/github_actions/codecov/codecov-action-5.3.1
build(deps): bump codecov/codecov-action from 5.3.0 to 5.3.1
2025-01-28 21:40:18 -05:00
dependabot[bot]
c62a98e652
build(deps): bump codecov/codecov-action from 5.3.0 to 5.3.1
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.3.0 to 5.3.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.3.0...v5.3.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-27 12:25:27 +00:00
dependabot[bot]
2eb6808e29
build(deps): bump codecov/codecov-action from 5.1.2 to 5.3.0 (#3292)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.1.2 to 5.3.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.1.2...v5.3.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-24 13:38:24 +01:00
miyamo2
8970f515dd
🐛 fix: Align cache middleware with RFC7231 (#3283)
* 🩹 Fix(v3;middleware/cache): don't cache if status code is not cacheable

* allow 418 TeaPot

* fix test

* fix lint error

* check cacheability with map

* documentation

* fix: markdown lint

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2025-01-20 08:22:51 +01:00
Juan Calderon-Perez
aa245aeaec
Merge pull request #3285 from grivera64/docs/add-c-drop-example
📚 Docs: Add `c.Drop()` example to `whats_new.md`
2025-01-19 02:39:19 -05:00
Juan Calderon-Perez
927e3b3266
Update whats_new.md 2025-01-19 02:38:34 -05:00
Giovanni Rivera
1dedc8034c
📚 Docs: Add c.Drop() example to whats_new.md
- Add Drop section with an example in `whats_new.md`
- Reorder `c.Drop()` and `c.End()` to match source code order
  in `whats_new.md`
2025-01-18 16:53:12 -08:00
Juan Calderon-Perez
156897ee1c
Merge pull request #3284 from aliziyacevik/master
[Maintenance]: Added ctx.Drop() to whats_new.md
2025-01-18 09:41:54 -05:00
aliziyacevik
b31184e0b7 Doc: Added missing ctx.Drop() to whats_new.md 2025-01-18 14:31:55 +03:00
Giovanni Rivera
a42ddc100e
🔥 feat: Add End() method to Ctx (#3280)
* 🔥 Feature(v3): Add End() method to Ctx

* 🎨 Style(Ctx): Respect linter in tests

* 🚨 Test(End): Add timeout test for c.End()

* 📚 Doc: Update End() documentation examples to use 4 spaces

* 🚨 Test: Update `c.End()` tests to use StatusOK

---------

Co-authored-by: Giovanni Rivera <grivera64@users.noreply.github.com>
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2025-01-16 11:54:46 +01:00
Juan Calderon-Perez
44b971ace5
Merge pull request #3277 from gofiber/dependabot/go_modules/github.com/mattn/go-colorable-0.1.14
build(deps): bump github.com/mattn/go-colorable from 0.1.13 to 0.1.14
2025-01-13 21:37:29 -05:00
Giovanni Rivera
4e5fea1d7a
🩹 Fix: Fix app.Test() auto-failing when a connection is closed early (#3279)
* ♻️ Refactor: Extract testConn err to variable

* ♻️ Refactor: Extract ErrTestGotEmptyResponse from app.Test()

* 🩹 Fix: Fix `app.Test()` auto-failing when testConn is closed

* 🩹 Fix(app_test.go): Use tab for indent instead of spaces

* 🩹 Fix(app_test.go): Fix to respect gofmt linter

* ♻️ Refactor: Update Drop tests to verify error type
2025-01-13 14:18:03 +01:00
dependabot[bot]
6c7473b842
build(deps): bump github.com/mattn/go-colorable from 0.1.13 to 0.1.14
Bumps [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable) from 0.1.13 to 0.1.14.
- [Commits](https://github.com/mattn/go-colorable/compare/v0.1.13...v0.1.14)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-colorable
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-10 12:46:21 +00:00
RW
bc37f209bf
refactor(timeout): unify and enhance timeout middleware (#3275)
* 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>
2025-01-08 08:19:20 +01:00
dependabot[bot]
86d72bbba8
build(deps): bump golang.org/x/crypto from 0.31.0 to 0.32.0 (#3274)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.31.0 to 0.32.0.
- [Commits](https://github.com/golang/crypto/compare/v0.31.0...v0.32.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-07 19:20:53 +01:00
René
a95ffd8eff fix doc examples for generic function 2025-01-06 08:36:06 +01:00
Giovanni Rivera
ac82b0c413
📚 Doc: Fix static middleware CacheDuration data type typo (#3273) 2025-01-03 10:36:58 +03:00
M. Efe Çetin
5355869d4d
🐛 bug: make Render bind parameter type any again (#3270)
* 🐛 bug: make Render bind parameter type any again

* update  docs
2025-01-02 08:42:25 +01:00
René
d5771a34df prepare release 3.0.0-beta.4 v3.0.0-beta.4 2024-12-31 17:00:40 +01:00
M. Efe Çetin
ef04a8a99e
🐛 bug: Fix square bracket notation in Multipart FormData (#3235)
* 🐛 bug: add square bracket notation support to BindMultipart

* Fix golangci-lint issues

* Fixing undef variable

* Fix more lint issues

* test

* update1

* improve coverage

* fix linter

* reduce code duplication

* reduce code duplications in bindMultipart

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Co-authored-by: René <rene@gofiber.io>
2024-12-31 16:34:28 +01:00
AuroraTea
d0e767fc47
📚 Doc: Optimize the menu item text (#3267) 2024-12-31 15:58:07 +01:00
dependabot[bot]
26e30c0672
build(deps): bump DavidAnson/markdownlint-cli2-action from 18 to 19 (#3266)
Bumps [DavidAnson/markdownlint-cli2-action](https://github.com/davidanson/markdownlint-cli2-action) from 18 to 19.
- [Release notes](https://github.com/davidanson/markdownlint-cli2-action/releases)
- [Commits](https://github.com/davidanson/markdownlint-cli2-action/compare/v18...v19)

---
updated-dependencies:
- dependency-name: DavidAnson/markdownlint-cli2-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-30 14:18:54 +01:00
Juan Calderon-Perez
845a7f8b8e
🧹 chore: Improve Performance of Fiber Router (#3261)
* Initial improvements

* Update test

* Improve RemoveEscapeChar performance

* Fix lint issues

* Re-add comments

* Add dedicated request handlers

* Fix lint issues

* Add test case for app.All with custom method

* Add test for custom Ctx and Request Methods

* Simplify test logic

* Simplify test
2024-12-29 19:34:34 +01:00
Bulat Bagaviev
775e0a73f3
🩹 Fix: Memory leak removal in the idempotency middleware (#3263)
* 🩹 Fix: Add key removal in MemoryLock

* Fixed concurrent deletion.

* Fix: idempotency middleware's MemoryLock

* Add MemoryLock benchmarks.

* Updated benchmarks: Add returning error handling

* Renamed benchmark: RepeatedKeys

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2024-12-28 14:29:31 +01:00
M. Efe Çetin
57744ebbe8
🐛 bug: fix EnableSplittingOnParsers is not functional (#3231)
* 🐛 bug: fix EnableSplittingOnParsers is not functional

* remove wrong testcase

* add support for external xml decoders

* improve test coverage

* fix linter

* update

* add reset methods

* improve test coverage

* merge Form and MultipartForm methods

* fix linter

* split reset and putting steps

* fix linter
2024-12-25 12:53:14 +01:00
ACHMAD IRIANTO EKA PUTRA
58677d5c86
feat: Add Drop method to DefaultCtx for silent connection termination (#3257)
* Add Drop method to DefaultCtx and remove redundant checks

Introduced a Drop method in DefaultCtx for closing connections, enabling easier resource management. Removed unnecessary nil-checks for headers in manager_msgp to simplify code logic. Added a unit test to ensure the new Drop method behaves as expected.

* Add `Drop` method to Fiber context API documentation

The `Drop` method allows silently terminating client connections without sending HTTP headers or a response body. This is useful for scenarios like mitigating DDoS attacks or blocking unauthorized access to sensitive endpoints. Example usage and function signature are included in the updated documentation.

* Remove extraneous blank line in documentation.

Eliminated an unnecessary blank line in the API context documentation for improved readability and formatting consistency. No functional changes were made to the content.

* Update API documentation example to return "Hello World!"

Revised the example code in the API documentation to return a generic "Hello World!" string instead of a dynamic response. This improves consistency and simplifies the example for easier understanding.

* Refactor Drop method and extend test coverage.

Simplified the Drop method by inlining the connection close call. Added new test cases to ensure proper handling of no-response scenarios and improved overall test coverage.

* fix golangci-lint issue

* Add test for Ctx.Drop with middleware interaction

This test ensures the correct behavior of the Ctx.Drop method when used with middleware, including response handling and error scenarios. It verifies that the middleware and handler properly handle the Drop call and its resulting effects.

* Add Drop method to DefaultCtx for closing connections

The Drop method allows closing connections without sending a response, improving control over connection handling. Also updated a test assertion to use StatusOK for improved readability and consistency.

* Refine Drop method comments to clarify error handling.

Explain the rationale for not wrapping errors in the Drop method. Emphasize that the returned error is solely for logging and not for further propagation or processing.

* Update Drop method documentation for clarity

Clarified the `Drop` method's behavior, specifying that it closes the connection without sending headers or a body. Added examples of use cases, such as DDoS mitigation and blocking sensitive endpoints.

* Refactor response header setting in middleware.

Replaced the direct header setting with the `Set` method for consistency and improved clarity. Removed a test case checking for a panic on closed response body as it is no longer applicable.
2024-12-23 08:20:41 +01:00
Juan Calderon-Perez
1c9b6cedce
Merge pull request #3256 from gofiber/dependabot/github_actions/codecov/codecov-action-5.1.2
build(deps): bump codecov/codecov-action from 5.1.1 to 5.1.2
2024-12-19 08:01:36 -05:00
RW
6a5d81d4c9
Update path.go
fix comment spelling
2024-12-19 14:00:17 +01:00
dependabot[bot]
725aa5ac00
build(deps): bump codecov/codecov-action from 5.1.1 to 5.1.2
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-19 12:33:45 +00:00
Kashiwa
69e5ccdd22
♻️ Refactor: Rename the Method Names of FormData and FormDatas (#3251) (#3255)
♻️ refactor: rename methods
2024-12-19 08:30:13 +01:00
Juan Calderon-Perez
c2b557c5ac
🧹 chore: Update documentation for Fiber client (#3249)
* Update client package inline documentation

* Update inline docs

* Update Client Request docs

* Fix formatting issues

* Update docs

* Update docs/client/response.md

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

* Add missing space

* Remove return statement

* Update request.go

* Update docs/client/response.md

* Update docs/client/hooks.md

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: RW <rene@gofiber.io>
2024-12-16 14:25:15 +01:00
Iliya
154c74d578
🔥 feat: Add support for configuring TLS Min Version (#3248)
* Make tls.Config MinVersion configurable

This commit will resolve #3239
For more info: https://github.com/gofiber/fiber/issues/3239

* Add documents about tls minimum version configurable

* Add if statement for don't allow to use TLS1.0 and TLS1.1

* Fix lint issues, add test for panic()

* Update docs

* Add test with valid TLS version

---------

Co-authored-by: Juan Calderon-Perez <jgcalderonperez@protonmail.com>
2024-12-16 09:07:41 +01:00
dependabot[bot]
02999352cd
build(deps): bump github.com/valyala/fasthttp from 1.57.0 to 1.58.0 (#3244)
* build(deps): bump github.com/valyala/fasthttp from 1.57.0 to 1.58.0

Bumps [github.com/valyala/fasthttp](https://github.com/valyala/fasthttp) from 1.57.0 to 1.58.0.
- [Release notes](https://github.com/valyala/fasthttp/releases)
- [Commits](https://github.com/valyala/fasthttp/compare/v1.57.0...v1.58.0)

---
updated-dependencies:
- dependency-name: github.com/valyala/fasthttp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Cookies should expire immediately as per RFC6265

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Juan Calderon-Perez <jgcalderonperez@protonmail.com>
Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2024-12-16 09:03:57 +01:00
Kashiwa
1134e1f408
🩹 fix: make SetValWithStruct set zero values and support more types #3167 (#3227)
* 🩹 fix: make SetValWithStruct set zero values and support more types

* 🚨 test: check zero in int_slice

* fix: SetValWithStruct does not exist in fiber v2

* 🩹fix: restrict supported types in SetValWithStruct

* 🩹fix: golangci-lint

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2024-12-13 11:14:11 +01:00
Juan Calderon-Perez
a63bd340a4
Merge pull request #3247 from gofiber/dependabot/go_modules/golang.org/x/crypto-0.31.0
build(deps): bump golang.org/x/crypto from 0.30.0 to 0.31.0
2024-12-12 07:55:56 -05:00
dependabot[bot]
f94ac3c609
build(deps): bump golang.org/x/crypto from 0.30.0 to 0.31.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.30.0 to 0.31.0.
- [Commits](https://github.com/golang/crypto/compare/v0.30.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-12 12:40:39 +00:00
Juan Calderon-Perez
ec485791ca
Merge pull request #3243 from gofiber/dependabot/go_modules/golang.org/x/crypto-0.30.0
build(deps): bump golang.org/x/crypto from 0.28.0 to 0.30.0
2024-12-10 08:59:53 -05:00
dependabot[bot]
b513a00f44
build(deps): bump golang.org/x/crypto from 0.28.0 to 0.30.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.28.0 to 0.30.0.
- [Commits](https://github.com/golang/crypto/compare/v0.28.0...v0.30.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-10 12:16:06 +00:00
M. Efe Çetin
e9849b758d
🔥 feat: Add support for iterator methods to Fiber client (#3228)
* chore: simplify parserRequestBodyFile logic

* client: add support for go1.23 iterators

* Apply suggestions from code review

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

* fix linter

* fix tests

* correct benchmark

* fix linter

* create docs

* update

* rename FormDatas -> AllFormData

* add examples for maps.Collect()

* change request/response markdown examples

---------

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: René <rene@gofiber.io>
2024-12-10 10:39:23 +01:00
Jinquan Wang
27cfd3c8cd
🔥 feat: Add support for AutoTLS / ACME (#3201)
* feat: add a simple support for app.Listen

* fix: fix the nil access error

* chore: add test case for simple tls

* fix: align the struct

* chore: change the test case

can't passed and not chack the file yet

* fix: use TLS1.2 min

* Fix lint issues

* Fix call to os.MkdirTemp

* Fix test check order

* Update unit-tests for ACME

* Update docs

* Fix identation of whats_new examples

* More updates to docs

* Remove ACME tests. Add check for tlsConfig

* Add ACME section to whats_new docs

* Update docs/whats_new.md

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

* Update fiber.md

* Update whats_new.md

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
Co-authored-by: Juan Calderon-Perez <jgcalderonperez@protonmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-12-10 10:12:33 +01:00
dependabot[bot]
70a06c5887
build(deps): bump github.com/tinylib/msgp from 1.2.4 to 1.2.5 (#3240)
Bumps [github.com/tinylib/msgp](https://github.com/tinylib/msgp) from 1.2.4 to 1.2.5.
- [Release notes](https://github.com/tinylib/msgp/releases)
- [Commits](https://github.com/tinylib/msgp/compare/v1.2.4...v1.2.5)

---
updated-dependencies:
- dependency-name: github.com/tinylib/msgp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 16:50:34 +03:00
Juan Calderon-Perez
4347857372
Merge pull request #3234 from gofiber/dependabot/github_actions/codecov/codecov-action-5.1.1
build(deps): bump codecov/codecov-action from 5.0.7 to 5.1.1
2024-12-06 08:58:05 -05:00
dependabot[bot]
1e38dbf345
build(deps): bump codecov/codecov-action from 5.0.7 to 5.1.1
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.0.7 to 5.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v5.0.7...v5.1.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-06 12:12:43 +00:00
Kashiwa
89a0cd3fa5
🔥 feat: Add support for graceful shutdown timeout in ListenConfig (#3220)
* 🔥 feat: Add support for graceful shutdown timeout in Listen

* 📚 doc: update the description of GracefulShutdownTimeout

* ♻️refact: use require.ErrorIs instead of require.Equal

* fix: Target error should be in err chain by using fasthttputil.ErrInmemoryListenerClosed

* ♻️refact: use require.ErrorIs instead of require.Equal

* 📚doc: update the description of GracefulShutdownTimeout

* ♻️refact: rename GracefulShutdownTimeout to ShutdownTimeout

* 🩹fix: set default ShutdownTimeout to 10s

---------

Co-authored-by: Juan Calderon-Perez <835733+gaby@users.noreply.github.com>
2024-12-04 13:55:36 +01:00