1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-22 13:53:32 +00:00

519 Commits

Author SHA1 Message Date
Michael Weiss
743d8ec08c
Fix comment (#1597)
When merging #1310, the corresponding adaptation of a code comment appears to have gone forgotten.
2021-10-25 18:37:50 +02:00
Gusted
36796ee7a1
fix: remove Test_Limiter_Cheat test (#1595) 2021-10-25 07:04:56 +02:00
RW
ff38081eb9
Fix - Etag README.md (#1584)
* Fix - Etag README.md

* Fix - Etag README.md
2021-10-19 11:36:16 +02:00
Gusted
e6feb36827
feat: add sliding window as option for limiter middleware (#1580)
- Add the options to use your own middleware(should be more modular over time).
- Add the Sliding window option(see #1247)
- A little bit better polished version of #1247.
2021-10-18 09:13:53 +02:00
James Li
c49940730d
chore(docs): fix example encoding issue in READMD.md of logger middleware (#1576)
Co-authored-by: James3 Li(李麒傑) <james3_li@asus.com>
2021-10-18 09:13:32 +02:00
IvanK Production
92a811c93e
Fix "Signaures" (expect "Signatures") word in middleware/encryptcookie/README.md (#1577) 2021-10-16 12:43:10 -04:00
Ali Eren Öztürk
9c37b4c1c5
Fix limit middleware skip options (#1568)
* fix limit middleware skip options

* fix limiter middleware remaining count

* used constant StatusBadRequest instead of int 400
2021-10-11 18:31:37 +02:00
Jose Garcia
587f3ae9df
Support for sub fiber's error handlers (#1560)
- Mounted fiber and its sub apps error handlers are now saved a new
  errorHandlers map in App
- New public App.ErrorHandler method that wraps the logic for which
  error handler to user on any given context
- Error handler match logic based on request path <=> prefix accuracy
- Typo fixes
- Tests
2021-10-05 14:03:20 +02:00
Fufu
8b3a06b164
Fix: file opening path and directory browsing path of filesystem (#1547)
* Fix: file opening path and directory browsing path of filesystem

* Update: utils.TrimRight instead of strings.TrimSuffix
2021-09-29 19:53:25 +02:00
Amal Shaji
afa53ae1f6
support logging color for custom logging formats (#1513) 2021-09-28 10:11:44 +02:00
Ali Eren Öztürk
2aef5f8e01
limiter middleware new options: SkipFailedRequests, SkipSuccessfulRequests (#1542) 2021-09-28 10:10:29 +02:00
M. Efe Çetin
c0c14671ba
Add one minute load avg for monitor. (#1530)
Fix CI/CD errors.

Fix Windows.

Fix Windows.

Fix golint error.
2021-09-22 08:29:44 +02:00
RW
2272e4a6b1
🐛 Get unexpected results from cache #1529 (#1531) 2021-09-15 14:20:43 +02:00
M. Efe Çetin
76b0d216c1
Add next support for Monitor middleware. (#1527) 2021-09-13 08:51:44 +02:00
RW
4096e72008
update logger readme 2021-08-31 12:48:56 +02:00
wernerr
426520b671 update encryptcookie documentation 2021-08-24 08:52:32 +02:00
wernerr
ca3696624d correct documentation for the skip middleware 2021-08-24 08:38:15 +02:00
Bhurinat Wangsutthitham
0e08bb4fe7
🐛 session should not regenerate the ID in case Get() returned nil (#1493)
* fix: session should not regenerate the ID in case Get() returned nil

* fix: prevent falsy unit-tests

* docs: improve wordings on tests
2021-08-23 08:32:14 +02:00
amir
bff8843abd
🔥 Feature: Add encrypt cookies middleware (#1343)
* 🔥 Feature: Add encrypt cookies middleware

* Encrypt cookies when error happens

* Improve encrypt cookie middleware

* Fix errors

* Update encryptcookie config doc blocks

* Change `SetCookie` to `SetCookieBytesKV` for invalid cookies

* Update middleware/encryptcookie/config.go

* Update README.md

* Remove `GenerateKey` parameter

* Update README.md

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>
2021-08-23 08:31:51 +02:00
thinklucrative
9a7b08ee23
Update README.md (#1472)
Typo:
var ConfigDefault = Config{
	KeyLookUp:    "cookie:session_id",
}

should be:
var ConfigDefault = Config{
	KeyLookup:    "cookie:session_id",
}
2021-08-05 20:14:32 +02:00
András Czigány
5f1acd3c56
🔥 Feature: Add Skip middleware (#1465)
* add Skip middleware

* middleware/skip: fix test expectations
2021-08-04 10:05:29 +02:00
goldwind-ting
846d5a5b38
[Logger]: add tag for response header (#1446)
* add TagRespHeader to get response header

* #1422:add unittest

* #1422:adjust docs for logger middleware

* #1422:adjust docs for logger middleware
2021-08-04 08:19:41 +02:00
RW
d777d889bb
Fix cache expired test (#1461)
* Improve/Stabilize the "Test_Cache_Expired" test run
2021-07-30 20:19:18 +02:00
Marcos de Oliveira
30ba99425f
Add ${port} logger variable (#1448)
* Add c.Addr() and c.Port() functions and logger port variable

* Add gofmt suggestion, README.md description and test

* Remove c.Addr() func and use c.fasthttp.RemoteAddr() instead
2021-07-22 17:42:29 +02:00
HugHunter
7cd8219420
Update README.md (#1444)
spotted a small mistake in the docs
2021-07-19 12:51:03 +02:00
Kazumasa Takenaka (Bamboo)
f5338266e3
fix typo (#1442)
paramters -> parameters
avilable  -> available
seperated -> separated
2021-07-17 17:20:14 +02:00
Spedoske
cd802dfead
Fix: copy the data in buffer instead of using original data. (#1425) 2021-07-11 12:35:02 +02:00
Spedoske
e082880297
Fix: Session middleware issues (#1407)
* Update session.go

Fix: Session.Regenerate does not set Session.fresh to be true.

* Fix: Session should be regenerated if the session can not be found in the storage
https://github.com/gofiber/fiber/issues/1408

* Add test for session and store in session middleware.

* Clean up code

* Update middleware/session/session.go

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>
2021-06-30 08:01:22 +02:00
tuhao1020
93dc33ad89
add tls config for http client in proxy middleware (#1393)
* add tls config for http client in proxy middleware

* update exmaple and make tls.config also affects to proxy.Balancer

* add Test_Proxy_Forward_WithTlsConfig

* add a variable of type *tls.Config

* add a RWMutex for clientTlsConfig

* remove global tls config

* Update README.md

* Update proxy.go

Co-authored-by: RW <rene@gofiber.io>
2021-06-24 08:13:18 +02:00
Javad Rajabzade
7609117cec
Improved some conditions (#1386)
* simplify `u <= (1<<7)-1` to `u < (1 << 7)`

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* It's not recommended to use `len` for empty string, we can check with string with ""

* Instead Bool comparison can using simplified bool check if !var = false checking

* Unnecessary use of fmt.Sprintf for value without format

* For check condition two value not required ! method

* nil check may not be enough for slice, better check with len

* function parameters combined

* When the form returns error information, the text content should not start with a capital letter or end with a punctuation mark

* error var invalidPath should have name of the form errFoo, It is recommended that the error variables that are part of an API should be named

* change to condition len(x), it's faster https://github.com/gofiber/fiber/pull/1386#discussion_r652369520

* Update write.go

* Update write_bytes.go

* Update store.go

Co-authored-by: RW <rene@gofiber.io>
2021-06-17 22:03:59 +02:00
João Victor Santos
c08568e247
🔥 feat: expiration per session (#1363)
* feat(middlewares): expiration per session

* test(middlewares): session with expiration

* docs(middlewares): session

* chore: apply suggestions from code review
2021-06-13 12:39:19 +02:00
Wei Lun
bca01cc9cc
🔥 Feature: add cache header to show cache status (#1368)
* add cache header to show cache status

* update default CacheHeader to X-Cache

* add CacheHeader test

* Update cache_test.go

use constants in test

Co-authored-by: RW <rene@gofiber.io>
2021-06-13 10:52:03 +02:00
hi019
a7d9c6816e
Fix session delete when there is one key (#1366)
* Add regression test, attempt solution

* Attempt 2
2021-06-05 20:15:06 +02:00
RW
8e89949381
🚀 Configure proxy.Balancer with custom timeout #1362 (#1364)
* 🚀 new possibility to escape special routing parameters, which gives the possibility to follow the google api design guide https://cloud.google.com/apis/design/custom_methods

* 🚀 new possibility to escape special routing parameters, which gives the possibility to follow the google api design guide https://cloud.google.com/apis/design/custom_methods

* 🚀 Configure proxy.Balancer with custom timeout or client #1362

* 🚀 Configure proxy.Balancer with custom timeout or client #1362
2021-06-04 16:54:03 +02:00
bestgopher
2d6323c197
:fix #1360 (#1361) 2021-06-03 16:02:17 +02:00
Costa
bad3abb8ed
fix comments in proxy middleware (#1355)
fix a little comment wrong in proxy middleware
2021-06-01 08:34:33 +02:00
LeoZhan
9b3662eae0
🔥 Customize the source of session_id (#1159)
* 🔥 Feature: Define KeyLookup configuration (#1110)

* 🔥 Feature: Allow session ID to be written in header (#1110)

* 🔥 Feature: Allow session ID to be obtained from different sources (#1110)

* 📚 Doc: Add Source configuration (#1110)
2021-05-29 02:48:25 +02:00
João Victor Santos
0de49175c7
feat(middlewares): session keys (#1337)
*  feat(midlewares): session keys

- added a sess.Keys() method who retrive all keys from current session

* docs(middlewares): session
2021-05-23 08:45:33 +02:00
bestgopher
2f05108351
fix pprof redirect path (#1330)
* 📒:fix redirect path

* ️:fix test case

* 📚:use constant instead of number

* 🔥:TrimRight instead of TrimSuffix
2021-05-19 12:47:07 +02:00
sadfun
547bdb1c23
Change deprecated struct elements (#1335)
Duration and Store are deprecated, so we should show Expiration and Storage in example
2021-05-18 10:56:55 +02:00
Tom
21c9fb4936
🔥 Add PathPrefix parameter to filesystem middleware (#1326)
See #1308

This adds a parameter called `PathPrefix` to `filesystem.Config`
that is prepended to any filepath being read from
`filesystem.Root`.

Intended to be used with Go 1.16's `embed.FS` type.

Signed-off-by: Tom <tom@tdpain.net>
2021-05-12 08:58:01 +02:00
Yash Garg
e7d5759733
📝update handler example in timeout (#1328) 2021-05-10 10:48:07 -04:00
Ivan Sotnikov
15cb3dc025
🐛 Cache Middleware - Race condition in the cache expiration logic. Round 2 (#1310)
* 🐛 fix: decrease watchdog period time
2021-05-04 09:18:48 +02:00
Sepehr Rafiei
a95e371920
🐛 Print logger's error to stderr if given io.writer failed (#1299)
Co-authored-by: Sepehr Rafiee <sepehr.rafiee@snapp.cab>
2021-04-25 10:32:35 +02:00
kiyon
3b9f78a02d
Merge pull request #1288 from fernandobandeira/master
 Etag middleware support to custom etags
2021-04-22 19:40:37 +08:00
Jean-Sébastien Ney
c3aafde9db
[middleware/proxy] add buffer size configuration (#1292)
* add buffer size

* add tests
2021-04-20 12:56:00 +02:00
Fernando Bandeira
72c84639be Etag middleware support to custom etags 2021-04-18 23:08:01 -03:00
Nik Schaefer
12b57db688
📚 Doc: Correct cors to favicon in import statement (#1279) 2021-04-11 21:07:31 +02:00
Nik Schaefer
a6868c24b9
📚 Doc: Correct Session to Crsf in Import (#1277) 2021-04-10 16:19:40 -04:00
Sagar Sonwane
ecfcf1cc00
♻️ Removed Printed Warning (#1268)
* ♻️ Removed Printed Warning

removed print statement for warning from monitor.go file

* 📝 Added Warning Message in Readme

added warning message in monitor middleware readme
2021-04-06 15:21:53 +02:00