🦺 make copy of body

pull/978/head
Fenny 2020-10-29 06:41:05 +01:00
parent 70d7c53557
commit 5bc5f96324
1 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import (
"time"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/utils"
)
// Config defines the config for middleware.
@ -203,7 +204,7 @@ func New(config ...Config) fiber.Handler {
}
// Cache response
entryBody = c.Response().Body()
entryBody = utils.SafeBytes(c.Response().Body())
entry.status = c.Response().StatusCode()
entry.cType = c.Response().Header.ContentType()