Commit Graph

3185 Commits (bd4f1538e098cab91566825e605bd00aa71d9689)

Author SHA1 Message Date
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 2022-04-15 16:01:43 +02:00
RW e9151e8ab8
Revert " feature: add SendFileWithConfig method to ctx (#1852)" (#1861)
This reverts commit f19ef67f73.
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 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 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 fdfc8da967.

* 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 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 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
Geet Manghnani a746e5bfb8
Restore Original URL of the context after changing it (#1788)
* Restore original URL after the proxy

* Use the Immutable string to restore

* Changing deprecated ImmutableString to CopyString

Co-authored-by: Geet Manghnani <gmanghna@in.ibm.com>
2022-02-20 21:59:47 +01:00
Vadim Gerasimenko c5f11cc800
Fix comment relating to deprecated field (#1790) 2022-02-20 19:01:16 +03:00
RW 1bbcb4b8f3
Fix for "Why net.Addr is fiber.testAddr, not *net.TCPAddr?🤗 #1574" (#1784) 2022-02-19 02:08:06 +01:00
Rendi Putra Pradana cf47f06ad1
📝 docs: translate some words to bahasa(ID) (#1780)
* docs: translate some words to bahasa

Translate:
download -> unduh
WebSocket support -> Mendukung WebSocket
Route Naming -> Penamaan Route
default -> bawaan

* 📝 docs: translate some words to bahasa(ID)
2022-02-15 15:48:30 +03:00
Fufu 7b1a7a9513
fix: utils.TrimBytes should trim all content (#1779)
* perf: if all string content should be trimmed, end the loop early

* test: complete test cases for all Trim functions

* fix: utils.TrimBytes should trim all content
2022-02-15 07:57:51 +01:00
M. Efe Çetin e1833df93c
docs: add SSE example (#1776) 2022-02-14 16:27:57 +01:00
RW daab00c36e
prepare release 2.27.0 2022-02-14 15:32:18 +01:00
Eren BALCI 74a20b4589
🩹 fix: backwards incompatible change to fiber.Error (#1768)
* fix: backwards incompatible change to fiber.Error

* revert: work backward compatible
2022-02-14 08:17:04 +01:00
Trim21 391ae594d8
fix: `utils.Trim` should trim all string content (#1775)
* fix: `utils.Trim` should trim all string content

* add empty string input

* better fix
2022-02-14 08:01:15 +01:00
M. Efe Çetin 937713e41e
feature: bind support for render (#1754)
* Bind support for Render.

* update

* fix tests

* split Pass-locals-to-views & Bind from Render

* update comments.

* add benchs.

* Update ctx.go

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

* Update ctx.go

* optimize

* switch dictpool.

*  feature: bind support for render
- improve performance

*  feature: bind support for render
- improve performance

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>
Co-authored-by: wernerr <rene.werner@verivox.com>
Co-authored-by: wernerr <rene@gofiber.io>
2022-02-12 22:52:24 +01:00