3195 Commits

Author SHA1 Message Date
Serhat Şevki Dinçer
29be6691c5
📊 add page title to monitor mw (#1893) 2022-05-05 15:27:48 +02:00
RW
17d1d3c2f3
prepare release 2.33.0 2022-05-05 14:59:33 +02:00
witer33
aace425119
fixed typo (#1891) v2.33.0 2022-05-02 15:35:24 +02:00
Pinank Solanki
bb9ac8feaf
🐛 Fix expiration time in cache middleware (#1881)
* 🐛 Fix: Expiration time in cache middleware

* Custom expiration time using ExpirationGenerator is also functional
now instead of default Expiration only

* 🚨 Improve Test_CustomExpiration

* - stabilization of the tests
- speed up the cache tests
- fix race conditions in client and client tests

Co-authored-by: wernerr <rene@gofiber.io>
2022-05-01 11:43:46 +02:00
dependabot[bot]
2326297bb8
Bump actions/checkout from 2 to 3 (#1885)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  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>
2022-05-01 11:09:32 +02:00
dependabot[bot]
03bdab962c
Bump reviewdog/action-golangci-lint from 1 to 2 (#1886)
Bumps [reviewdog/action-golangci-lint](https://github.com/reviewdog/action-golangci-lint) from 1 to 2.
- [Release notes](https://github.com/reviewdog/action-golangci-lint/releases)
- [Commits](https://github.com/reviewdog/action-golangci-lint/compare/v1...v2)

---
updated-dependencies:
- dependency-name: reviewdog/action-golangci-lint
  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>
2022-05-01 10:38:59 +02:00
dependabot[bot]
ab260fd080
Bump actions/setup-go from 1 to 3 (#1887)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 1 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  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>
2022-05-01 10:33:46 +02:00
dependabot[bot]
60c9a5399e
Bump actions/cache from 1 to 3 (#1888)
Bumps [actions/cache](https://github.com/actions/cache) from 1 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  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>
2022-05-01 10:33:37 +02:00
dependabot[bot]
6d63e9fa1c
Bump github/codeql-action from 1 to 2 (#1889)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-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>
2022-05-01 10:21:58 +02:00
Abdulaziz
d277bbfce3
reduce duplicate in Get method (#1880)
make code more clear to people!
2022-05-01 09:34:53 +02:00
Naveen
bd4f1538e0
chore: Included githubactions in the dependabot config (#1883)
This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2022-05-01 09:32:19 +02:00
Vano Devium
901492a784
utils: ConvertToBytes: empty string (#1877) 2022-04-24 19:15:59 +02:00
ChandanChainani
941ada9f05
Fix cannot process array of values in application/x-www-form-urlencoded request (#1873)
* Renamed parseQuery to parseParamSquareBrackets

* Added square brackets processing for `application/x-www-form-urlencoded`

* Added test cases for Array of form values
2022-04-24 12:25:36 +02:00
Vano Devium
63391d47b4
utils: ConvertToBytes (#1875)
* utils: ConvertToBytes

* remove unneeded compare with golang function

* remove unneeded compare with golang function

* Update common_test.go

* utils: ConvertToBytes

Speed improvement
old:
Benchmark_ConvertToBytes/fiber-8                 3541161                317.9 ns/op          128 B/op          2 allocs/op
Benchmark_ConvertToBytes/fiber-8                 3465039                336.8 ns/op          128 B/op          2 allocs/op

new:
Benchmark_ConvertToBytes/fiber-12               32883782                33.76 ns/op            0 B/op          0 allocs/op
Benchmark_ConvertToBytes/fiber-12               36084900                33.47 ns/op            0 B/op          0 allocs/op

Co-authored-by: RW <rene@gofiber.io>
2022-04-24 12:06:06 +02:00
TomRomeo
bea756f624
✏️ Typo fix in ParamsInt() (#1863) 2022-04-16 15:32:25 -04:00
Ankush Menat
bd2acbb5a9
chore: remove incorrect links from supporter table (#1862) 2022-04-15 19:54:14 +02:00
RW
cbb63c0c3c
prepare release 2.32.0 v2.32.0 2022-04-15 16:01:43 +02:00
RW
e9151e8ab8
Revert " feature: add SendFileWithConfig method to ctx (#1852)" (#1861)
This reverts commit f19ef67f73f140a92e7359fdf83acabc6a5db094.
2022-04-15 15:54:18 +02:00
M. Efe Çetin
c42af6d2ca
feature: support adding queries to RedirectToRoute (#1858)
* Support adding queries for RedirectToRoute method.

* fix security check.

*  feature: support adding queries to RedirectToRoute

Co-authored-by: wernerr <rene@gofiber.io>
2022-04-15 15:32:39 +02:00
Serhat Şevki Dinçer
e7ec08a1e9
📖 fix ListenTLS comment (#1859)
* 📖 fix ListenTLS comment

* 📖 fix ListenMutualTLS comment
2022-04-14 15:55:00 +03:00
M. Efe Çetin
f19ef67f73
feature: add SendFileWithConfig method to ctx (#1852)
* add sendfilewithconfig.

* update

* shortify code.
2022-04-14 10:49:48 +02:00
M. Efe Çetin
a63a842fb6
add allparams method. (#1853) 2022-04-14 10:48:41 +02:00
M. Efe Çetin
ee65ea5bab
🧹 Use encoding/json (#1851)
* remove goccy/go-json

* fix tests.
2022-04-13 10:45:33 +02:00
dependabot[bot]
728e9231de
Bump github.com/valyala/fasthttp from 1.34.0 to 1.35.0 (#1849)
Bumps [github.com/valyala/fasthttp](https://github.com/valyala/fasthttp) from 1.34.0 to 1.35.0.
- [Release notes](https://github.com/valyala/fasthttp/releases)
- [Commits](https://github.com/valyala/fasthttp/compare/v1.34.0...v1.35.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>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-06 20:08:52 +02:00
RW
a8f9d4acfb
🐛 Sub fiber's error handlers not working #1839 (#1848)
fix root level bug
2022-04-05 08:40:22 +02:00
akp
e974c6793f
RFC: Return an instance of *fiber.Error when no handler found (#1847)
* Return an instance of `*fiber.Error` when no handler found

When a handler cannot be found for a given path, previously Fiber
would construct a plaintext response that cannot be modified.

This commit switches to returning a new instance of `*fiber.Error`
with identical error message so that users can customise the look
of their 404 pages.

Signed-off-by: AKP <tom@tdpain.net>

* Fix `Test_App_Next_Method`

This test was failing as the error returned by `c.Next()` that's
required to generate the correct 404 status code was not being
passed through the middleware and being silently ignored.

Signed-off-by: AKP <tom@tdpain.net>

* Fix `Test_Logger_All`

Signed-off-by: AKP <tom@tdpain.net>

* Fix `Test_Cache_WithHeadThenGet` test

As far as I can tell, this test is meant to check that a cached
HEAD request to a given endpoint does not return the cached
content to a GET request to the same endpoint, and the test has
been altered to correctly check for this.

Signed-off-by: AKP <tom@tdpain.net>
2022-04-05 08:39:53 +02:00
Andrey Kuvshinov
16b8717a29
Add context Writef feature function (#1841) 2022-04-01 19:15:06 +02:00
RW
907fdfa9fd
prepare release 2.31.0 v2.31.0 2022-03-30 10:01:44 +02:00
Serhat Şevki Dinçer
2b5b6b24ee
🐛 utils: fix EqualFold and docs (#1833)
* 🔍 utils: add/improve tests for ToLower/ToUpper/EqualFold

* 🐛 utils: fix EqualFold and docs
2022-03-23 13:55:13 +01:00
Serhat Şevki Dinçer
2f0d745b5a
🆙 bump goccy/go-json to 0.9.6 (#1832) 2022-03-22 13:21:46 +03:00
Neenad Ingole
44bfdc3d6b
🩹 Allow parsing of square bracket query param (#1818) 2022-03-22 09:13:56 +01:00
Sujit Baniya
af339a851f
Change name to get URL from (#1831)
* Add Global Layout for view render

* Add test case for Views Layout

* Update ctx_test.go

* Add App Name function to pass custom app name

* Remove json tag for function

* Change func to string

* Add test for AppName

* Add RedirectToRoute and RedirectBack with fallback if referer in header not found

* replace errors.New with fmt.Errorf

* simplified code

* Add tests for different formats

* Add method to get route location and add benchmarks

* Add ToString function

* Fix error

* rearrange case for fmt.Stringer

* Fix bug for error return

* Lock latest route for app.Name(namee string)

* decreasing timeout for client test with timeout

* remove println and adjust condition to > 0

* Change name to get route url

* Change name to get route url

* Update ctx.go

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>

Co-authored-by: RW <rene@gofiber.io>
Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>
2022-03-22 09:13:30 +01:00
RW
528b8b4630
prepare release 2.30.0 v2.30.0 2022-03-21 14:57:01 +01:00
M. Efe Çetin
1c4ebf85f1
⬆️ add go1.18 to tests and docs (#1819)
* 👷 tests: add go1.18

* Update benchmark.yml

* update readmes
2022-03-15 17:43:49 +01:00
Vadim Gerasimenko
c92a5056ae
🩹 Fix limiter middleware db connection (#1813)
* remove release() method

* Revert "remove release() method"

This reverts commit fdfc8da967204f58f0342a5141a00cc07e1cccac.

* Rearrange mutexes in limiter_fixed.go

* refactor limiter_fixed.go

* Update limiter_fixed.go

Co-authored-by: RW <rene@gofiber.io>
2022-03-15 12:41:28 +01:00
M. Efe Çetin
bd20e90e6b
feature: add initial support for hooks (#1777)
* Add initial support for hooks.

* release ctx, mutex.

* Add unit tests.

* add comment lines.

* update

* update

* remove unnecessary code.

* fix race condition.

* fix gosec.

* skip error handling for onshutdown and onresponse.

* update

* separate hooks from app.go

* make hooks field private, hook struct public and Hooks() func.

* remove onreq and onres because of they can be done by middlewares.

* OnGroupName method.

* Update hooks.go

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>

* handle errors for name and groupname

* fix tests.

* Update app.go

* use struct fields instead of map

* add multi-handler.

* add onGroup, make prefix field public on Group struct.

* Update hooks.go

* add newhooks method.

*  feature: add initial support for hooks

* remove ctx from hooks.

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>
Co-authored-by: wernerr <rene@gofiber.io>
2022-03-10 08:35:15 +01:00
RW
166e55eec6
prepare release 2.29.0 v2.29.0 2022-03-08 13:55:10 +01:00
Théotime Lévêque
1cddc56f13
Cache middleware: Store e2e headers. (#1807)
*  Cache middleware: Store e2e headers.

As defined in RFC2616 - section-13.5.1, shared caches MUST
store end-to-end headers from backend response and MUST be
transmitted in any response formed from a cache entry.

This commit ensures a stronger consistency between responses
served from the handlers & from the cache middleware.

*  Cache middleware: Add flag for e2e headers.

Set flag to prevent e2e headers caching to
be the default behavior of the cache middleware.
This would otherwise change quite a lot the
experience for cache middleware current users.

*  Cache middleware: Add Benchmark for additionalHeaders feature.

*  Cache middleware: Rename E2Eheaders into StoreResponseHeaders.

E2E is an acronym commonly associated with test.
While in the present case it refers to end-to-end
HTTP headers (by opposition to hop-by-hop), this
still remains confusing. This commits renames it
to a more generic name.

*  Cache middleware: Update README

*  Cache middleware: Move map instanciation.

This will prevent an extra memory allocation for users
not interested in this feature.

*  Cache middleware: Prevent memory allocation when StoreResponseHeaders is disabled.

*  Cache middleware: Store e2e headers. #1807
- use set instead of add for the headers
- copy value from the headers -> prevent problems with mutable values

Co-authored-by: wernerr <rene@gofiber.io>
2022-03-08 10:18:04 +01:00
dependabot[bot]
0120531fcc
Bump github.com/valyala/fasthttp from 1.33.0 to 1.34.0 (#1811)
Bumps [github.com/valyala/fasthttp](https://github.com/valyala/fasthttp) from 1.33.0 to 1.34.0.
- [Release notes](https://github.com/valyala/fasthttp/releases)
- [Commits](https://github.com/valyala/fasthttp/compare/v1.33.0...v1.34.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>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-08 08:37:26 +01:00
Edward zZhang
f2391a9688
update some translation (#1815) 2022-03-07 23:08:47 -05:00
Serhat Şevki Dinçer
870f9427a2
Optimize App.buildTree() (#1809)
*  Optimize App.buildTree()

- Reduces reads from / writes to slices
- Reduces reads from maps
- Increases sorting speed

*  Add Benchmark_Startup_Process()
2022-03-07 19:01:30 +01:00
M. Efe Çetin
10fa3ef6f5
🤖 deps: bump goccy/go-json to v0.9.5 (#1808)
* bump goccy/go-json to 0.9.4

* bump goccy/go-json to 0.9.5
2022-03-05 21:19:03 +01:00
Théotime Lévêque
df85b62a78
🐛 Fix go-json generator. (#1806)
go generate ./... generates panic as import paths have
probably changed over time. This commit free this command
from panics.
2022-03-05 15:39:34 +03:00
Théotime Lévêque
d0934df656
✏️ Cache middleware: Fix comment typo in manager.go. (#1804) 2022-03-05 15:36:51 +03:00
Serhat Şevki Dinçer
8b0170c0f4
🔗 Fix goreportcard & pkg.go.dev links in READMEs (#1798)
* 🔗 Fix goreportcard & pkg.go.dev links in READMEs

* 🔗 Fix package comment for pkg.go.dev links

* 🔗 Replace golang.org links with go.dev in READMEs

Co-authored-by: RW <rene@gofiber.io>
2022-03-03 11:54:56 +01:00
M. Efe Çetin
5c1ddb3245
Translation fixes (#1800) 2022-03-03 11:23:06 +01:00
RW
a033ca240b
📒 Update readme (#1794)
* 📒 Update readme
- add some middlewares
- add section for awesome list

* 📒 Update readme
- add some middlewares
- add section for awesome list

* 📒 Update readme
- add some middlewares
- add section for awesome list
2022-02-28 10:22:17 +01:00
RW
d4c3f27023
prepare release 2.28.0 v2.28.0 2022-02-28 08:19:40 +01:00
M. Efe Çetin
a7032b7a17
Update TLS Config & Add ListenMutualTLS (#1761)
* deprecations

* Add mTLS support.

* update

* update

* Update app.go
2022-02-24 08:01:42 +01:00
M. Efe Çetin
b0dd0bdb14
Update app.go (#1787) 2022-02-22 08:10:55 +01:00