3444 Commits

Author SHA1 Message Date
Trim21
21c6e4044e
Merge remote-tracking branch 'upstream/v3-beta' into bind 2023-01-11 17:19:24 +08:00
leonklingele
0b5a7d0425
🚀 Feature: Add idempotency middleware (#2253)
* middleware: add idempotency middleware

* middleware/idempotency: use fiber.Storage instead of custom storage

* middleware/idempotency: only allocate data if really required

* middleware/idempotency: marshal response using msgp

* middleware/idempotency: add msgp tests

* middleware/idempotency: do not export response

* middleware/idempotency: disable msgp's -io option to disable generating unused methods

* middleware/idempotency: switch to time.Duration based app.Test

* middleware/idempotency: only create closure once

* middleware/idempotency: add benchmarks

* middleware/idempotency: optimize strings.ToLower when making comparison

The real "strings.ToLower" still needs to be used when storing the data.

* middleware/idempotency: safe-copy body
2023-01-06 08:46:17 +01:00
fgy
081809e8a6 feat: support float 2023-01-05 12:30:11 +08:00
Muhammed Efe Çetin
7345517868
add old methods 2022-12-14 19:22:39 +03:00
leonklingele
6334f2c9ff
🚀 v3 Feature: Make app.Test accept a time.Duration timeout (#2269)
app: make app.Test accept a time.Duration timeout

Cases found by running semgrep with an empty .semgrepignore file

    semgrep --lang=go -e '$O.Test($X, $Y)'
2022-12-12 20:39:52 +01:00
leonklingele
fd1a29ea79
🚀 Feature: Generate msgp tests (#2263)
* middleware: also generate msgp tests

* middleware/session: drop unused go:generate directive

* middleware: disable msgp's -io option to not generate unused methods
2022-12-11 17:40:07 +01:00
leonklingele
802defa5ff
v3 (chore): cleanup (#2255)
* middleware: switch to new Ctx interface in documentation

* all: use any instead of interface{}
2022-12-03 15:39:57 +03:00
Muhammed Efe Çetin
77d14848b8
v3: fix tests 2022-11-27 23:00:09 +03:00
Muhammed Efe Çetin
41830699d1
support pointer fields 2022-11-27 21:34:20 +03:00
Muhammed Efe Çetin
4aec4fc8be
👷 v3 (ci): make workflows runnable on v3-beta branch 2022-11-27 20:42:17 +03:00
Muhammed Efe Çetin
c62dd16e8d
Merge remote-tracking branch 'origin/master' into v3-beta 2022-11-27 20:34:48 +03:00
dependabot[bot]
f8457f2eea
Bump github.com/valyala/fasthttp from 1.41.0 to 1.42.0 (#2237)
Bumps [github.com/valyala/fasthttp](https://github.com/valyala/fasthttp) from 1.41.0 to 1.42.0.
- [Release notes](https://github.com/valyala/fasthttp/releases)
- [Commits](https://github.com/valyala/fasthttp/compare/v1.41.0...v1.42.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-24 16:32:17 +01:00
RW
8952d170fe
prepare release v2.40.1 v2.40.1 2022-11-23 09:05:31 +01:00
RW
0d038cba46
fix typo 2022-11-21 08:54:34 +01:00
Muhammed Efe Çetin
3661d336c8
add support for queries like data[0][name] (not yet supporting deeper nested levels) 2022-11-20 19:46:53 +03:00
M. Efe Çetin
291fb6e444
🐛 bug: fix mounting when mount prefix is / (#2227) 2022-11-20 14:26:42 +01:00
RW
82db2963be
Update vulncheck.yml 2022-11-20 14:26:32 +01:00
RW
fc35dbf927
Update linter.yml 2022-11-20 14:05:03 +01:00
RW
70403aa120
Update security.yml 2022-11-20 14:04:46 +01:00
RW
c8baa613ae
prepare release v2.40.0 v2.40.0 2022-11-18 16:21:47 +01:00
RW
e4b3b5c708
Improve interface for custom logger func (#2225)
* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal

* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal

* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal

* - logger: fix custom tag
- use real bytebufferpool dependency instead of the internal
2022-11-18 15:32:56 +01:00
Andy Pan
92ce4aac77
📝 Update middleware/logger docs (#2224)
* 📝 Update middleware/logger docs

Update #2219

* Update middleware/logger/README.md

Co-authored-by: RW <rene@gofiber.io>
2022-11-18 14:29:53 +01:00
René Werner
3d39b82aad logger: adjustment for the new Done function - use nil instead of empty func 2022-11-18 13:23:57 +01:00
skyenought
e8f8cb647b
Add customTags in logger middleware Config (#2188)
*  Add customTags in logger middleware Config

* improve tags with parameter

* improve logger performance

* improve logger performance

* improve logger performance

* improve logger performance

Co-authored-by: René Werner <rene@gofiber.io>
2022-11-18 13:10:43 +01:00
Muhammed Efe Çetin
6cb876a51b
add basic nested binding support (not yet for slices) 2022-11-17 16:00:33 +03:00
Muhammed Efe Çetin
d52652ef83
Merge remote-tracking branch 'origin/v3-beta' into bind 2022-11-15 23:11:33 +03:00
Andy Pan
3157fb5f1c
Add callback function for middleware/logger (#2219)
*  Add callback function for middleware/logger

* Refine test code
2022-11-15 12:14:32 +01:00
Caleb Case
61b4496067
Track Configured Values (#2221)
* WIP: Use Parent Error Handler on Mount

* Add suggested boolean guard

* Move flag to App

* Move to copy of config as configured

* Apply the same trick to customMethod
2022-11-15 12:13:11 +01:00
leonklingele
debdb8c4cd
v3: router: return status 501 instead of 400 on unknown method (#2220)
* router: return status 501 instead of 400 on unknown method

501 is more applicable here.

* router: ensure to always release context

* ctx: fix tests
2022-11-15 12:01:34 +01:00
leonklingele
235cd9df82
ctx: simplify Protocol() (#2217)
* ctx: simplify Protocol()

* ctx: also mention "X-Url-Scheme" header in Protocol()

* ctx: use the same warning comment about enabling Config.EnableTrustedProxyCheck everywhere
2022-11-14 08:32:48 +01:00
leonklingele
b288a9f54e
ctx: make Secure() also report whether a secure connection was established to a trusted proxy (#2215)
We had a discussion about this in https://github.com/gofiber/helmet/pull/74.
2022-11-14 08:22:35 +01:00
leonklingele
a0645af1ed
Fix and optimize memory storage (#2207)
* internal/memory: cache timestamp

* internal/memory: ensure to never delete non-expired items

This fixes a TOCTOU problem between a mutex rlock and a mutex lock.

* internal/memory: move costly operations outside of locked area

* internal/storage: cache timestamp

* internal/storage: ensure to never delete non-expired items

This fixes a TOCTOU problem between a mutex rlock and a mutex lock.

* internal/storage: move costly operations outside of locked area
2022-11-14 08:21:03 +01:00
M. Efe Çetin
e5ae764139
🧹 update: replace UnsafeBytes util with suggested way (#2204) 2022-11-13 16:58:42 +01:00
M. Efe Çetin
8aeb147c75
feature: add multiple-prefix support to app.Use() and group.Use() (#2205) 2022-11-13 16:56:34 +01:00
hs son
20109922aa
Add korean translate in Installation section (#2213) 2022-11-13 15:39:15 +03:00
Muhammed Efe Çetin
73b43cc93e
🧹 v3 (chore): replace dictpool with sync.Map 2022-11-12 11:50:02 +03:00
leonklingele
5cac575ad0
utils: reduce diff to external utils package (#2206)
f33fd2c5f7/bytes.go
2022-11-12 08:27:57 +01:00
Muhammed Efe Çetin
938e0fcea4
♻️ sync other langs with README.md 2022-11-12 09:26:47 +03:00
leonklingele
4d562923aa
README: update list of third-party library licenses (#2211) 2022-11-12 09:10:07 +03:00
leonklingele
e388e0edb3
Update HTTP status codes (#2203)
* helpers: add HTTP status code 306

* helpers: show numeric HTTP status code instead of status code RFC next to errors

* utils: add HTTP status code 425

* helpers,utils: update list of HTTP status codes
2022-11-11 08:40:37 +01:00
Rafi Muhammad
878c9549d8
Feat: Register custom methods (#2107)
* Implementing register custom methods

* Return timout time to 1000

* Update app_test.go

* Change update stack to add custom request method

* Feat: Register custom methods #2107

* Feat: Register custom methods #2107

* update logic

* optimization.

* fix

Co-authored-by: Rafi Muhammad <rafi.muhammad@mekari.com>
Co-authored-by: RW <rene@gofiber.io>
Co-authored-by: Muhammed Efe Çetin <efectn@protonmail.com>
2022-11-11 08:23:30 +01:00
M. Efe Çetin
581af0052d
🐛 bug: fix naming of routes inside groups (#2199)
* 🐛 bug: fix naming of routes inside groups

* fix tests

* bug: fix naming of routes inside groups

Co-authored-by: René Werner <rene@gofiber.io>
2022-11-09 16:03:16 +01:00
Glenn Lewis
13247206ab
Add URL prefix to pprof middleware (#2194)
* Add URL prefix to pprof middleware

Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>

* Minor tweak

Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>

Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
2022-11-09 07:59:33 +01:00
skyenought
55fcddda6f
📝 Update README_zh-CN.md (#2186) 2022-11-09 07:56:58 +01:00
kinggo
486f3709ed
ci: add check-latest param in vulncheck.yml (#2197)
ci: add check-latest param
2022-11-08 14:20:14 +01:00
Eren BALCI
24fd165660
v3 (feature): new mounting system (#2022)
* 🔥 chore: removed mount from router

*  feat: new mounting system

*  feat: mount for group

*  test: updated and improve for new mount system

* ♻️ refactor: better variable name

* ♻️ refactor: better function naming

* 🐛 fix: not mounted check

*  test: update onmount test if sub app is not mounted to parent

* 🎨 perf: fix allocs problem

*  test: add benchmark for MountPath

*  feat: access to app's mountpath

*  test: remove parent app's mountpath test

* remove some parts

* add comment

* fix

Co-authored-by: Muhammed Efe Çetin <efectn@protonmail.com>
Co-authored-by: RW <rene@gofiber.io>
2022-11-03 10:55:31 +01:00
M. Efe Çetin
87cedc2022
👷 ci: replace snyk with govulncheck (#2178) 2022-11-01 08:50:33 +01:00
James R T
c63a569a92
🚀 [Feature]: Allow optional params with route constraints (#2179)
Signed-off-by: James R T <jamestiotio@gmail.com>

Signed-off-by: James R T <jamestiotio@gmail.com>
2022-11-01 08:49:44 +01:00
pj
709e0952e2
v3 (feature): router interface changes (#2176)
* Add(methods []string, path string, handlers ...Handler) Router

* - proposed Router interface changes

Co-authored-by: rocketlaunchr-cto <rocketlaunchr.cloud@gmail.com>
2022-11-01 08:45:43 +01:00
Andy Pan
24a6170323
♻️ Leverage runtime/debug to print the full stack trace info (#2183) 2022-10-31 15:12:43 +01:00