fiber/middleware
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
..
2021-11-05 08:00:03 +01:00
2020-11-21 12:36:16 -05:00
2021-11-05 08:00:03 +01:00
2021-11-05 08:00:03 +01:00
2021-11-05 08:00:03 +01:00
2021-11-05 08:00:03 +01:00
2022-01-14 22:31:44 -05:00
2021-12-06 13:35:47 +01:00