Commit Graph

15 Commits (691d2e6ad5c565eea26676a04064cf99fd515b84)

Author SHA1 Message Date
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
M. Efe Çetin 4103f9463d
feature: customizable colors (#1977)
*  feature: customizable colors

*  feature: customizable colors

*  feature: customizable colors
2022-08-01 08:24:37 +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
M. Efe Çetin 59240b5493
Add GetRespHeader, GetReqHeaders and TagReqHeaders for logger mw (#1678)
* Add GetRespHeader & GetReqHeaders methods.

* Add TagReqHeaders for logger middleware.

* Update README.md
2021-12-31 13:03:08 +01: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
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
Zuolar 4dcb490489
fix logger [WARNING: DATA RACE] (#1226)
* fix logger [WARNING: DATA RACE]
* add logger unit test for data race
2021-03-17 08:08:15 +01:00
Abhishek Kumar cae82d0a2f 🩹 Fix: fix test for response body 2021-01-24 15:00:51 +00:00
Abhishek Kumar e8c3a0fac3 🩹 Fix: add separate test for resBody logger variable 2021-01-24 13:11:46 +00:00
Abhishek Kumar 9c18716885 🔥 Feature: add proper tests for new logger variables 2021-01-24 11:21:10 +00:00
Abhishek Kumar 7c36b32194 🩹 Fix: reference to logger issue #1115 2021-01-23 17:19:33 +00:00
Fenny 67eed4c721 🚀 restore benchmark
Co-Authored-By: Rafael Cossovan <navossoc@gmail.com>
2020-10-28 03:56:54 +01:00
Fenny 17b6597ec8 💼 add locals to logger
Co-Authored-By: Rafael Cossovan <navossoc@gmail.com>
2020-10-28 03:54:40 +01:00
kiyon b007a87e4a 👷 add logger test cases 2020-09-17 13:34:23 +08:00
kiyon 0088a6900a 🍱 improve logger performance 2020-09-16 14:07:40 +08:00