Commit Graph

752 Commits (export-buildtree)

Author SHA1 Message Date
Jason McNeil 2374cad3cd
📄 docs: improve csrf docs (#2726)
* docs: improve csrf docs

- fix issues with `X-Csrf-Token` capitalization inconsistency.
- reduce redundancy and repetition.
- improve grammar.

* docs: update middleware description

* docs: within vs in

* docs: deleting tokens

* docs: MUST

* docs: add colon

* docs: all modern browsers

* docs: patterns

* docs: improve phrasing of pattern options
2023-11-16 12:34:31 +01:00
nickajacks1 1e55045a30
test(limiter): fix intermittent failures (#2716)
The limiter middleware unit tests are failing due to a race between the
storage garbage collector and the unit test itself. The sliding window
limiter tracks requests using memory storage. In several of the unit
tests, this storage expiry ends up being 4 seconds. The test waits for 4
seconds, then sends a request, expecting it to succeed. However, the
unit test occasionally wakes up before the storage GC kicks in. As an
effect of the very coarse timer (using seconds as units), the middleware
correctly rejects the request, causing the test to fail.

Update the sleep to 4.5 seconds. This will not slow down the execution
of the test suite, as these tests run in parallel with a separate 9
second long test.

I'm not 100% sure this solves the issue, and ideally we'd be able to
run tests without time.Sleep.
2023-11-10 11:33:10 +01:00
database64128 b99712f13e
middleware/pprof: improve performance (#2709)
*  middleware/pprof: improve performance

Concatenate the custom and fixed prefixes beforehand, so the trimmed path can be switched on against constant strings.

goos: linux
goarch: amd64
pkg: github.com/gofiber/fiber/v2/middleware/pprof
cpu: 13th Gen Intel(R) Core(TM) i9-13900K
BenchmarkPprof/Slow-32         	 4912642	       246.3 ns/op	     480 B/op	      10 allocs/op
BenchmarkPprof/Fast-32         	411908472	         2.913 ns/op	       0 B/op	       0 allocs/op
PASS

* 🌂 middleware/pprof: disable nonamedreturns linter on cutPrefix
2023-11-09 08:05:54 +01:00
Muhammed Efe Cetin f37238e494
v3: fix CSRF tests and linter warnings 2023-11-07 20:37:57 +03:00
Muhammed Efe Cetin 6ea4d81331
Merge branch 'master' into v3-beta 2023-11-07 20:22:31 +03:00
Jason McNeil 8c3916dbf4
Merge pull request from GHSA-94w9-97p3-p368
* feat: improved csrf with session support

* fix: double submit cookie

* feat: add warning cookie extractor without session

* feat: add warning CsrfFromCookie SameSite

* fix: use byes.Equal instead

* fix: Overriden CookieName KeyLookup cookie:<name>

* feat: Create helpers.go

* feat: use compareTokens (constant time compare)

* feat: validate cookie to prevent token injection

* refactor: clean up csrf.go

* docs: update comment about Double Submit Cookie

* docs: update docs for CSRF changes

* feat: add DeleteToken

* refactor: no else

* test: add more tests

* refactor: re-order tests

* docs: update safe methods RCF add note

* test: add CSRF_Cookie_Injection_Exploit

* feat: add SingleUseToken config

* test: check for new token

* docs: use warning

* fix: always register type Token

* feat: use UUIDv4

* test: swap in UUIDv4 here too

* fix: raw token injection

* fix: merege error

* feat: Sentinel errors

* chore: rename test

* fix: url parse

* test: add path to referer

* test: add expiration tests

* docs: add cookie prefix note

* docs: fix typo

* docs: add warning for refer checks

* test: add referer edge cases

And call ctx.Request.Reset() and
ctx.Response.Reset() before re-using ctx.
2023-10-16 09:06:30 +02:00
René Werner bb90fc1187 fix lint errors 2023-10-11 15:16:35 +02:00
Jason McNeil b50d91d58e
Merge pull request from GHSA-94w9-97p3-p368
* feat: improved csrf with session support

* fix: double submit cookie

* feat: add warning cookie extractor without session

* feat: add warning CsrfFromCookie SameSite

* fix: use byes.Equal instead

* fix: Overriden CookieName KeyLookup cookie:<name>

* feat: Create helpers.go

* feat: use compareTokens (constant time compare)

* feat: validate cookie to prevent token injection

* refactor: clean up csrf.go

* docs: update comment about Double Submit Cookie

* docs: update docs for CSRF changes

* feat: add DeleteToken

* refactor: no else

* test: add more tests

* refactor: re-order tests

* docs: update safe methods RCF add note

* test: add CSRF_Cookie_Injection_Exploit

* feat: add SingleUseToken config

* test: check for new token

* docs: use warning

* fix: always register type Token

* feat: use UUIDv4

* test: swap in UUIDv4 here too
2023-10-11 14:41:42 +02:00
M. Efe Çetin 9292a36e28
🐛 bug: fix nil pointer dereference issue on idempotency middleware (#2668) 2023-10-10 08:23:23 +02:00
Michael Bell 8228da91fc
[filesystem middleware] improve status for SendFile (#2664)
SendFile response code for success
2023-10-06 13:10:20 +02:00
René Werner 59409f3841 improve sendFile documentation 2023-10-06 11:43:10 +02:00
Tiago Peczenyj 0d3354675b
Fix loop variable captured by func literal (#2660)
* fix loop variable xxx captured by func literal

* fix middleware/pprof tests
2023-10-05 13:49:57 +02:00
Tiago Peczenyj ab4e731607
Run gofumpt and goimports (#2662)
* run goimports -w -local github.com/gofiber/fiber .

* run gofumpt -w -extra .
2023-10-05 13:14:30 +02:00
KaptinLin d00f0b8348
feat: add Reset method to Session struct in session middleware (#2654) 2023-10-02 15:19:35 +02:00
KaptinLin d86c257c89
feat: add Delete method to Store struct in session middleware (#2655)
*  feat: add Delete method to Store struct in session middleware

* ♻ refactor: enhance Delete method and test cases in session middleware
2023-10-02 15:19:18 +02:00
M. Efe Çetin 6e443f6026
refactor: use utils.AssertEqual instead of t.Fatal on some tests (#2653) 2023-09-28 14:40:42 +02:00
M. Efe Çetin a9447a5b49
ctx: change signatures of GetReqHeaders and GetRespHeaders (#2650)
* ctx: change signatures of GetReqHeaders and GetRespHeaders

* fix middlewares
2023-09-28 08:31:31 +02:00
M. Efe Çetin e6d6fbe5a8
middleware: cors: allow disabling caching in preflight requests (#2649) 2023-09-27 15:06:24 +02:00
Juan Calderon-Perez 5d6552e42d
🐛 fix(middleware/adaptor): Reduce memory usage by replacing io.ReadAll() with io.Copy() (#2637)
* Replace io.ReadAll with io.Copy for Adaptor Middleware

* Add nolint to Close() during benchmark
2023-09-19 08:08:51 +02:00
CuiPeiyu d0d5e9ee99
[middleware/filesystem]: Set response code (#2632)
Specified response code
2023-09-14 14:46:34 +02:00
Akarshit Joshi 6d34e23815
[Bug]: Logger Middleware: Enabling color changes padding for some fields #2604 (#2616)
🐛 Removes extra padding for response code, method
2023-09-11 08:45:00 +02:00
Eng Zer Jun 242ff94505
♻️ Refactor: Remove redundant nil check (#2584)
From the Go docs:

  "If the map is nil, the number of iterations is 0." [1]

Therefore, an additional nil check for before the loop is unnecessary.

[1]: https://go.dev/ref/spec#For_range

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-08-17 20:49:53 +02:00
Jacob 892b23bd46
Add custom data property to favicon middleware config (#2579)
* Add custom data property to favicon middleware

* Update favicon middleware docs

* Fix formatting
2023-08-17 15:04:53 +02:00
Jason McNeil c3ae06608b
🐛 fix(middleware/logger): default latency output format (#2580)
* fix: default logger formater latency

* test: add Test_Logger_WithLatency_DefaultFormat

* test: rm t.Parallel() from Latency tests

Trying to make windows CI pass....

* test: fix windows sleep issue
2023-08-17 14:33:59 +02:00
0bl a50df4fcdd
🩹 Fix: rename WithTlsConfig method to WithTLSConfig (#2570)
* 🩹 Fix: rename WithTlsConfig method to WithTLSConfig

* 🎨 Style: remove stylecheck and revive lint
2023-08-11 07:57:49 +02:00
Jason McNeil 35da4c6a75
test: fix text 2023-08-10 16:04:29 -03:00
Jason McNeil 7b1aa8a612
chore: rm debug 2023-08-10 15:35:16 -03:00
Jason McNeil acf427c4bb
chore: TagLatency match gin-gonic/gin format 2023-08-10 15:27:25 -03:00
M. Efe Çetin 9fbb961adb
filesystem: refactor: use `errors.Is` instead of `os.IsNotExist` (#2558) 2023-08-06 18:10:44 +02:00
João Victor Oliveira Couto f29f39b1b3
fix: Decompress request body when multi Content-Encoding sent on request headers (#2555)
* 🔧 feat: Decode body in order when sent a list on content-encoding

* 🚀 perf: Change `getSplicedStrList` to have 0 allocations

* 🍵 test: Add tests for the new features

* 🍵 test: Ensure session test will not raise an error unexpectedly

* 🐗 feat: Replace strings.TrimLeft by utils.TrimLeft

Add docs to functions to inform correctly what the change is

* 🌷 refactor: Apply linter rules

* 🍵 test: Add test cases to the new body method change

* 🔧 feat: Remove return problems to be able to reach original body

* 🌷 refactor: Split Body method into two to make it more maintainable

Also, with the previous fix to problems detected by tests, it becomes really hard to make the linter happy, so this change also helps in it

* 🚀 perf: Came back with Header.VisitAll, to improve speed

* 📃 docs: Update Context docs
2023-08-06 17:23:37 +02:00
Muhammed Efe Cetin 44acb06c02
🧹 v3 (chore): fix linter warnings 2023-08-05 22:25:21 +03:00
Muhammed Efe Cetin 75bb02b87e
Merge remote-tracking branch 'origin/master' into v3-beta 2023-08-05 22:02:01 +03:00
RW 51ea636b60
improved the config section of the middleware readme´s (#2552) 2023-07-24 16:46:50 +02:00
Jiun Lee fefc533834
🚀 Add Logger interface and fiberlog (#2499)
* add log for fiber

* replace log in fiber

* add Log use to adapt for log libraries

* Update app.go

Co-authored-by: Tomás Warynyca <41587659+tomaswarynyca@users.noreply.github.com>

* wip: add log docs

* add WithLogger use to print key and value

* remove CtxLogger and add WithContext use to bind Context

* fix errcheck

* fix errcheck

* update log.md

---------

Co-authored-by: Tomás Warynyca <41587659+tomaswarynyca@users.noreply.github.com>
2023-06-26 08:16:57 +02:00
Moein Halvaei 5967d36bc0
✏️ Fix typo (#2518)
* Fix: typo in client.go

* Fix: typo in ctx.go

* Fix: typo in path.go

* Fix: typo in router.go

* Fix: typo in adaptor.go
2023-06-23 16:15:38 +02:00
cmd777 1b060cb150
🩹 Fix: default logger color behaviour (#2513)
* Fix logger colors

* Fix tests
Basically add ˙enableColors: true˙ back to default config
2023-06-22 13:06:37 +02:00
Anzhi 06ef450a8a
🚀 Add DisableColors to set the default output format (#2493)
Add DisableColor for default logger format
2023-06-05 13:20:45 +02:00
Oleg b9e93ccd4a
Fix Sliding Window limiter when SkipSuccessfulRequests/SkipFailedRequests is used. (#2484)
* Fix Sliding Window limiter when SkipSuccessfulRequests/SkipFailedRequests is used.

* Add tests.

* Fix linter.

---------

Co-authored-by: Oleg Bakumenko <Bakumenko.Oleg@wb.ru>
2023-06-01 08:00:31 +02:00
leonklingele c56b4e66a0
middleware/adaptor: allow to convert fiber.Ctx to (net/http).Request (#2461) 2023-05-15 13:04:58 +02:00
M. Efe Çetin c7c37d9b50
♻️ refactor: merge some external middlewares to core (#2453)
* ♻️ refactor: merge adaptor, helmet, keyauth, redirect, rewrite middlewares to core

* fix linting issues

* fix linting issues

* fix linting issues

* update
2023-05-10 08:01:49 +02:00
bcd 3c3f12b76c
[Feature]: Add filesystem config contentTypeCharset support (#2438)
* Update filesystem.go

* Update filesystem_test.go

* Update filesystem.md

* fmt
2023-05-02 08:40:20 +02:00
RW 3a7dbd0b48
🚀 Consistent way of logging and fix middleware log format #2432 (#2444)
- change log patter
2023-05-01 18:52:30 +02:00
Kousik Mitra a59d9bac59
🚀 Consistent way of logging and fix middleware log format (#2432)
* 🚀 Replace fmt.Print* with log.Print* (#2402)

* 🚀 Fix middleware logging format (#2402)
2023-05-01 10:01:27 +02:00
James Lucas c4d2876d64
🐛 fix(cors): Changed condition for 'AllowOriginsFunc' (#2423)
🐛 fix(cors): Changed condition for 'AllowOriginsFunc' to check against default config value of 'AllowOrigins'
2023-04-21 13:37:53 +02:00
James Lucas 866d5b7628
feat(cors): Added new 'AllowOriginsFunc' function. (#2394)
*  feat(cors): Added new 'AllowOriginsFunc' function.

* feat(cors): Added warning log for when both 'AllowOrigins' and 'AllowOriginsFunc' are set.

* feat(docs): Updated docs to include note about discouraging the use of this function in production workloads.

---------

Co-authored-by: RW <rene@gofiber.io>
2023-04-11 10:24:29 +02:00
Hakan Kutluay 22b407e2e7
🐛 [Bug-Fix] add original timeout middleware (#2367)
* add original timeout middleware

* fix linter issues

* deprecate original timeout middleware

* update timeout middleware documentation
2023-04-09 16:05:51 +02:00
René Werner 035e7d4f43 Fix #2396, data race logger middleware 2023-04-02 14:36:00 +02:00
René Werner 243f393434 Fix #2396, data race logger middleware 2023-04-02 14:08:20 +02:00
Rorke76753 56839b433e
🚀 [Feature]: middleware/requestid: don't call "Generator" func on existing request ID header (#2371)
call uuid generator only if rid is empty
2023-03-15 09:45:42 +01:00
Benjamin Grosse d7b36cde54
🐛 requestid.Config.ContextKey is interface{} (#2369)
requestid.Config.ContextKey is interface{}

Consistent with c.Locals(key inteface{}, ...).
Fixes #2356
2023-03-14 19:37:10 +01:00
Tumushimire Yves 634f163e3f
🚀 [Feature]: SessionOnly when cookie.Expires is 0 (#2152)
* feature: session only for zero expire cookie #2145

* refactor condition to set MaxAge and Expire on cookie

* move checking zero maxage and expire in session middleware

Signed-off-by: Yves Tumushimire <yvestumushimire@gmail.com>

* feature: session only for zero expire cookie #2145

* refactor condition to set MaxAge and Expire on cookie

* move checking zero maxage and expire in session middleware

Signed-off-by: Yves Tumushimire <yvestumushimire@gmail.com>

* CR changes

* some updates

---------

Signed-off-by: Yves Tumushimire <yvestumushimire@gmail.com>
Co-authored-by: Muhammed Efe Çetin <efectn@protonmail.com>
Co-authored-by: René Werner <rene.werner@verivox.com>
2023-03-12 19:14:22 +01:00
Muhammed Efe Çetin 41866cd3dd
👷 v3 (ci): fix some linter warnings 2023-03-06 17:35:39 +03:00
Muhammed Efe Çetin 15e9235383
📝 docs: remove README.mds from middleware dirs 2023-03-06 16:42:35 +03:00
Caio Augusto 44fd1976e7
fix(docs): add missing comma (#2353)
fix: add missing comma

nothing too much but it's a fix :p
2023-03-05 23:26:06 +03:00
Juan Calderon-Perez dc038d8233
Feature: Add DoRedirects, DoTimeout and DoDeadline to Proxy middleware (#2332)
* Add support for DoRedirects

Signed-off-by: Juan Calderon-Perez <jgcalderonperez@protonmail.com>

* Fix linter issues

Signed-off-by: Juan Calderon-Perez <jgcalderonperez@protonmail.com>

* Add example to README

* Add support for DoDeadline and DoTimeout. Expand unit-tests

* Fix linter errors

Signed-off-by: Juan Calderon-Perez <jgcalderonperez@protonmail.com>

* Add examples for Proxy Middleware

---------

Signed-off-by: Juan Calderon-Perez <jgcalderonperez@protonmail.com>
2023-02-24 15:09:00 +01:00
Ryan Devenney b634ba0a58
fix cors * behavior #2338 (#2339)
🐛- fix cors * behavior #2338
2023-02-20 22:36:34 +01:00
Michail Safronov 497eb02b48
Basic auth alloc (#2333)
* basic_auth: extend benchmark for uppercase Basic

* basic_auth: check space after basic (and avoid alloc if Basic)

* fixup! basic_auth: check space after basic (and avoid alloc if Basic)
2023-02-13 22:48:55 +01:00
Muhammed Efe Çetin 3168a60605
👷 v3 (ci): fix some linter warnings 2023-02-09 23:15:21 +03:00
Muhammed Efe Çetin c2749c36c2
👷 v3 (ci): fix some linter warnings 2023-02-09 22:33:45 +03:00
Muhammed Efe Çetin 088cde594d
Merge remote-tracking branch 'origin/master' into v3-beta 2023-02-05 23:43:42 +03:00
ACHMAD IRIANTO EKA PUTRA 61a3336119
add forward from domain (#2323)
* add forward from domain

* add balancer forward

* add unittest and readme

* add short description new feature

* add short description on signature

* golangci-lint fix

---------

Co-authored-by: René Werner <rene@gofiber.io>
2023-02-03 14:45:27 +01:00
René Werner 028d821bea prepare release 2023-02-03 13:59:47 +01:00
Алексей Колесников 21cd45b750
PR: add url for favicon middleware, for correct handling different of… (#2231)
* PR: add url for favicon middleware, for correct handling different of ico formats

* pr:  efectn > URL would be better naming i think

* pr: add test case

* apply reviews

* remove json annotinos, since they are unnecessary

* readme fixes

* linting fixes

---------

Co-authored-by: koalan <kolesnikov.khv@gmail.com>
Co-authored-by: Muhammed Efe Çetin <efectn@protonmail.com>
2023-02-03 10:14:24 +01:00
M. Efe Çetin 2820aef585
🧹 chore: add go 1.20 to ci and readmes (#2322)
*  chore: add go 1.20 to ci and readmes

* 🧹 chore: add go 1.20 to ci and readmes

* update linter

* fix linter

* fix benchmarks

* fix benchmarks

* fix benchmarks
2023-02-02 23:01:37 +03:00
leonklingele ac4ce21d9c
🐛 Bug: Fix issues introduced in linting PR (#2319)
* internal: revert linting changes

Changes to the internal package should not have been made in 167a8b5e94.

* middleware/monitor: revert changes to exported field "ChartJSURL"

This is a breaking change introduced in 167a8b5e94.

* middleware/monitor: fix error checking

Fix the errorenous error checking introduced in 167a8b5e94.

* 🐛 Bug: Fix issues introduced in linting PR #2319

* 🐛 Bug: Fix issues introduced in linting PR #2319

* Bug: Fix issues introduced in linting PR #2319

---------

Co-authored-by: René Werner <rene@gofiber.io>
2023-02-02 15:57:40 +01:00
leonklingele 44d09209e7
🚀 Feature: Add earlydata middleware (v2 backport) (#2314)
* 🚀 Feature: Add earlydata middleware (#2270)

* middleware: add earlydata middleware

* middleware/earlydata: address comments

* Update README.md

* Update README.md

Co-authored-by: RW <rene@gofiber.io>

* middleware/earlydata: backport to v2

Backport of https://github.com/gofiber/fiber/pull/2270 to v2.

---------

Co-authored-by: RW <rene@gofiber.io>
2023-01-30 12:08:01 +01:00
meehow de7e2b57e5
openssl rand -base64 32 (#2316)
* openssl rand -base64 32

* Apply suggestions from code review

---------

Co-authored-by: RW <rene@gofiber.io>
2023-01-30 08:47:47 +01:00
Xiaoyue Lin 6dc7a123fb
📝 docs(filesystem): clean duplicated namespace for example (#2313)
chore: clean duplicated namespace
2023-01-28 15:48:43 +08:00
leonklingele 7170b2a40d
🚀 Feature: Add earlydata middleware (#2270)
* middleware: add earlydata middleware

* middleware/earlydata: address comments

* Update README.md

* Update README.md

Co-authored-by: RW <rene@gofiber.io>
2023-01-27 11:21:18 +01:00
leonklingele 167a8b5e94
🚀 Feature: Add and apply more stricter golangci-lint linting rules (#2286)
* golangci-lint: add and apply more stricter linting rules

* github: drop security workflow now that we use gosec linter inside golangci-lint

* github: use official golangci-lint CI linter

* Add editorconfig and gitattributes file
2023-01-27 09:01:37 +01:00
Xiaoyue Lin 07ab88278b
📝 docs(filesystem): fix statik filesystem middleware example typo (#2302)
docs(filesystem): fix statik filesystem middleware example typo
2023-01-18 08:23:19 +01:00
M. Efe Çetin 5406560033
🧹 chore: make most tests parallel (#2299)
* 🧹 chore: make most tests parallel

* revert some tests

* revert some tests

* revert some tests
2023-01-15 23:21:37 +08:00
cloudwindy 0628b95a3d
Fix: logger color output (#2296) 2023-01-14 20:18:57 +08:00
leonklingele adcf92dec1
🚀 Feature: Add idempotency middleware (v2 backport) (#2288)
* 🚀 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

* middleware/idempotency: backport to v2
2023-01-13 08:38:50 +01: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
TwiN ad5250a6ff
📝docs(middleware): fix alignment in limiter example (#2283)
docs(middleware): Fix indentation in limiter example

Noticed a small formatting issue while going through the docs.
2023-01-05 12:32:28 +08: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
kinggo efeea7a4b5
optimize: latency use lowest time unit in logger middleware (#2261) 2022-12-10 21:56:43 +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
kinggo 075dfc5a8a
optimize: set byteSent log to 0 when use SetBodyStreamWriter (#2239) 2022-12-01 09:19:26 +01:00
leonklingele 17dfcc756b
middleware/requestid: mention that the default UUID generator exposes the number of requests made to the server (#2241) 2022-12-01 09:11:14 +01:00
Xaver Fischer 6d798dbda9
📝 middleware/filesystem does not handle url encoded values on it's own (#2247)
* 📝 middleware/filesystem does not handle url encoded values

* Update README.md

add newline after first warning

Co-authored-by: Xaver Fischer <xaverfischer@mail.de>
2022-12-01 08:53:40 +01:00
Muhammed Efe Çetin c62dd16e8d
Merge remote-tracking branch 'origin/master' into v3-beta 2022-11-27 20:34:48 +03: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
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
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
Andy Pan 24a6170323
♻️ Leverage runtime/debug to print the full stack trace info (#2183) 2022-10-31 15:12:43 +01:00
Kris Carr f26d9b1d4e
v3 (deps): update to use gofiber/utils/v2 (#2184) 2022-10-31 16:44:53 +03:00
Muhammed Efe Çetin 543e8bb7ea
v3: fix tests 2022-10-28 18:19:02 +03:00
Muhammed Efe Çetin 9428befb9c
Merge remote-tracking branch 'origin/master' into v3-beta 2022-10-28 17:26:17 +03:00
M. Efe Çetin 691d2e6ad5
🗑️ deprecate: go 1.14 & go 1.15 support deprecation (#2172)
* 🗑️ deprecate: go 1.14 & go 1.15 support deprecation
https://github.com/valyala/fasthttp/pull/1379

* fix tests
2022-10-26 11:51:50 +02:00
Diego Parisi eb692727c5
✏️ Fix: comment typo (#2173)
Just a typo

I think there's a typo "unmashal" for "unmarshal"
2022-10-25 19:05:57 +03:00
marcmartin13 4d584c9c9b
📝 Cache readme and docs update (#2169)
* Update README.md

* update no-store request directive

added cache status unreachable

* Update cache.go
2022-10-25 07:52:28 +02:00
marcmartin13 c187c6a2f5
🚀 [Feature]: Cache-Control: no-cache (#2159)
* Added noCache field

Check if the request header Cache-Control contains no-cache

* Update cache.go

* Update config.go

* Update cache.go

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1

* patch-1
2022-10-21 10:28:31 +02:00
kinggo 5fb93fdff6
🐛 fix: multi-byte AppName displays confusion (#2148)
fix: solve wrong print width
2022-10-21 08:30:56 +02:00
RW ce2d087394
Improve memory storage (#2162)
* improve memory storage code and performance

* improve memory storage code and performance

* improve memory storage code and performance

* improve memory storage code and performance

* improve memory storage code and performance

* improve memory storage code and performance
2022-10-19 16:22:42 +02:00