1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-21 07:33:06 +00:00

192 Commits

Author SHA1 Message Date
Gusted
7b7dcf29f7
♻️ Tidy up the codebase (#1613)
* run gofmt

* add t.Helper()

* Simplify assigns

* Simplify make operation

* Remove unused field in struct

* Fix typo

* Run gofumpt ./

* Consistent spacing

* len(...) can never be negative

* Use ReplaceAll

* Simplify operation

* Remove deadcode

* Fix typo

* Tidy up `} else { if ...`

* Fix AssertEqual

* Remove t.Helper() to fix go1.14.15
2021-11-05 08:00:03 +01:00
M. Efe Çetin
9eaa8b0c73
Change default json lib. (#1563)
* Change default json lib.

* Remove gopsutil test.

* Fix tests.

* Ignore linter for UnmarshalFieldError.

* update
2021-10-11 08:28:06 +02:00
Rock
a9b66b328e
♻️ Option to overide form decoder setting - Rename function (#1555)
* 🔥 add function to overide form decoder setting

🔥 Feature : SetBodyParserDecoder map all option to form decoder, use with BodyParserConfig, BodyParserType

🚨 Test : Test_Ctx_BodyParser_WithSetBodyParserDecoder

* 🔥 Use decoder builder function with default setting on init decoderPool

* ♻️ rename SetBodyParserDecoder to SetParserDecoder

BodyParserType > ParserType
bodyParserConfig > parserConfig
BodyParserConfig > ParserConfig
2021-10-04 08:37:24 +02:00
Rock
35e38db771
🔥 Add function to override form decoder setting (#1100)
* 🔥 add function to overide form decoder setting

🔥 Feature : SetBodyParserDecoder map all option to form decoder, use with BodyParserConfig, BodyParserType

🚨 Test : Test_Ctx_BodyParser_WithSetBodyParserDecoder

* 🔥 Use decoder builder function with default setting on init decoderPool
2021-10-01 08:32:06 +02:00
Iván Valdés
26c29e248f
Restore original URL after sending file (#1553) 2021-10-01 08:30:47 +02:00
Thammachart Chinvarapon
842b63022d
🐛 Fix Mutability issue of UserContext in fiber.Ctx (#1522)
* existing tests clean up

* concurrent test for UserContext Reused

* comment on Ctx.userContext field

* userContext tests edited & fixed, userContext field removed, constant of userContextKey defined
2021-09-09 08:11:26 +02:00
Shirshendu Bhowmick
d89207831d
🐛 Fix: ctx.BodyParser was not able to parse vendor specific content type (#1506) 2021-08-22 17:53:14 +02:00
Pranay
670170f7c5
📝 Update: Add JSONDecoder to config (#1489)
* 📝 Update: Add JSONDecoder to config
2021-08-18 14:26:07 +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
faceair
1e0d4d3b1c
🐛 fix parse gzipped body (#1458) 2021-07-30 08:02:02 +02:00
Vahagn Mkrtchyan
f0ab2a5433
Add option to specify default values for ParamsInt (#1453) 2021-07-26 19:50:56 +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
wja513
dd45be693a
cookie: add possibility to disable same site attribute (#1428)
* fix some old browsers cann't set the cookie if it contains SameSite property.

* add "SameSite" attribute constants and test case.

Co-authored-by: wangjiangao <wangjiangao@360.cn>
2021-07-16 20:08:17 +02:00
Oleg Roshnivskyy
5ba78cd24a
🔥 Feature: Add TrustedProxies feature (#1397)
* 🔥 Feature: Add TrustedProxies feature

Add TrustedProxies feature to prevent HTTP header spoofing.

* Update ctx.go

* Update app.go

* Update app.go

Co-authored-by: hi019 <65871571+hi019@users.noreply.github.com>
2021-06-30 08:03:45 +02:00
Andreas
2703e92c5d
Added decompression cases for Body function (#1402)
* Added decompression cases for Body function

* Fixed signature of Body() function

* Removed regex, added Header.Peek

* Added test case with compression

* Added Benchmark, moved compression names to helpers and made them constants

* Added long brotli as a constant

* Update ctx.go

improve Body function

* Update ctx.go

improve performance

* Fixed formatting

* Update helpers.go

Co-authored-by: RW <rene@gofiber.io>
2021-06-24 07:47:21 +02:00
Sujit Baniya
cb5f2f7eab
🔥 Add Global ViewLayout (#1384)
* Add Global Layout for view render

* Add test case for Views Layout

* Update ctx_test.go
2021-06-14 11:10:49 +02:00
Kshitij Patil
8616b41517
🔥 Adding user context (#1341)
* Adding user context

* adding docblock

* correcting comments

* minor change in comment

* Update ctx.go

Co-authored-by: RW <rene@gofiber.io>
2021-05-24 00:46:52 -04:00
SianLoong
da1877f16c
🏗️ chore: enable decoder's ZeroEmpty by default (#1285) 2021-05-17 15:46:36 +02:00
Diego Sandrim
0dc67e80d2 Moves .getBytes and .getString from package variable to App instance variable, avoiding data race when creating a new App. 2021-05-05 17:24:26 -03:00
Eduardo Andrés Castillo Perera
47f44f3960
Add method to get an integer directly from the Ctx params (route params) (#1243)
* Created ParamsInt method in Ctx
* Created test for the ParamsInt method
* Recover accidentally removed comments
2021-03-28 15:49:51 +02:00
SianLoong
861e5d21fb
🐛 Fix unexpected result when QueryParser parse slice data type (#1238) 2021-03-24 20:12:57 +01:00
Yoofi Quansah
5941c8c4e2 🧹 chore: address comments, and use more standard definition for
functionality we define
2021-01-25 13:48:07 -06:00
Yoofi Quansah
2267f0f76f 🚀 feat: add custom definition for a json executor 2021-01-19 20:25:44 -08:00
ReneWerner87
c893e3243b 🐛 UnescapePath not working #1102
Co-authored-by: Fenny <fenny@gofiber.io>
2021-01-06 19:06:13 +01:00
ReneWerner87
4f5e57d8de 🐛 UnescapePath not working #1102
Co-authored-by: Fenny <fenny@gofiber.io>
2021-01-06 13:46:50 +01:00
ReneWerner87
e94e653ca7 🐛 UnescapePath not working #1102
Co-authored-by: Fenny <fenny@gofiber.io>
2021-01-06 13:24:26 +01:00
ReneWerner87
b51def0bb8 🐛 UnescapePath not working #1102
Co-authored-by: Fenny <fenny@gofiber.io>
2021-01-06 13:21:54 +01:00
Fenny
3242e5b151 🚀 allow incase-sensitive ctypes in bodyparser
Co-Authored-By: Mones Zarrugh <11161902+moneszarrugh@users.noreply.github.com>
2020-12-11 00:59:32 +01:00
Fenny
a1879ceca8 🚧 refactor bodyparser
Co-Authored-By: Mones Zarrugh <11161902+moneszarrugh@users.noreply.github.com>

#1067
2020-12-11 00:56:54 +01:00
Fenny
1468a049c4 ✏ removeNewLines is present in fh 1.18
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
Co-Authored-By: kiyon <kiyon@gofiber.io>
2020-12-11 00:49:57 +01:00
Kiyon
d6d831e2b1 👷 fix lint 2020-11-30 13:49:13 +08:00
Fenny
c9bbc9fc54 📚 update JSON description
Co-Authored-By: nickland03 <52105217+nickland03@users.noreply.github.com>
2020-11-01 10:46:19 +01:00
ckcks12
e0122f261c 🐛 queryparser: query args count based condition removed 2020-10-26 14:48:21 +09:00
ReneWerner87
d8961a7ed9 🐛 Fix (*Ctx).Accepts
Co-authored-by: Fenny <fenny@gofiber.io>
Co-authored-by: navossoc <navossoc@gmail.com>
2020-10-24 20:06:13 +02:00
yonbiaoxiao
d622469203 improve base uri for ctx 2020-10-19 14:01:34 +08:00
Fenny
c0efbcd28c
Merge pull request #908 from hi019/master
🐛 Make SendFile return 404 if file not found
2020-10-10 16:26:21 +02:00
hi019
2c8df2e337 🎨 Use NewError in SendFile 2020-10-09 23:11:44 -04:00
hi019
b73e883241 🐛 Make SendFile return 404 if file not found 2020-10-09 21:42:25 -04:00
David Mazary
618b753230 🚨 Fix gosimple lint warnings 2020-10-03 13:20:54 -04:00
Fenny
e5e9cf9201 🍪 add max-age to cookie 2020-09-30 15:31:46 +02:00
Fenny
d6f717148a 🛠 correct convert naming 2020-09-27 12:22:17 +02:00
Fenny
3fbc1470c6 🏀 Support splitting in QueryParser
Co-Authored-By: Nathaniel Peiffer <nathaniel@peiffer.com.au>
2020-09-20 12:15:53 +02:00
Fenny
cb7f084615
Merge pull request #812 from ReneWerner87/improveErrorHandling
☠️ Improve error handling flow
2020-09-19 09:19:31 +02:00
ReneWerner87
c822a17c72 ☠️ Improve error handling flow
Co-authored-by: Fenny <fenny@gofiber.io>
Co-authored-by: Kiyon <kiyon@gofiber.io>
2020-09-18 20:44:00 +02:00
Fenny
4163d4473a 📦 introduce WriteString 2020-09-18 11:52:06 +02:00
Fenny
2768ea2a77 🙌 make utils public
Co-Authored-By: RW <7063188+ReneWerner87@users.noreply.github.com>
2020-09-14 12:12:29 +02:00
Fenny
a09daabfee move utils to internal 2020-09-14 09:24:48 +02:00
Fenny
a3cac71ae8 🔦 move utils to internal 2020-09-14 09:09:06 +02:00
Fenny
3d76f078a4 v2 2020-09-14 04:54:26 +02:00
Fenny
2951c6ac0d v2 2020-09-13 11:39:55 +02:00