mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-21 07:33:06 +00:00
🩹 Fix 403 Directory Index is Forbidden (#329)
* Fix Directory Index is Forbidden
This commit is contained in:
parent
27a7b21716
commit
75604b0254
@ -266,8 +266,10 @@ func (app *App) registerStatic(prefix, root string, config ...Static) {
|
||||
}
|
||||
// Serve file
|
||||
fileHandler(c.Fasthttp)
|
||||
// End response when file is found
|
||||
if c.Fasthttp.Response.StatusCode() != 404 {
|
||||
|
||||
// Finish request if found and not forbidden
|
||||
status := c.Fasthttp.Response.StatusCode()
|
||||
if status != 404 && status != 403 {
|
||||
return
|
||||
}
|
||||
// Reset response
|
||||
|
Loading…
x
Reference in New Issue
Block a user