1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-22 14:33:29 +00:00

Improve ctx.BodyParser speed -> remove toLower

This commit is contained in:
ReneWerner87 2020-07-21 22:48:17 +02:00
parent 778c035767
commit 165b0b6107

2
ctx.go
View File

@ -235,7 +235,7 @@ func (ctx *Ctx) BodyParser(out interface{}) error {
defer decoderPool.Put(schemaDecoder)
// Get content-type
ctype := utils.ToLower(getString(ctx.Fasthttp.Request.Header.ContentType()))
ctype := getString(ctx.Fasthttp.Request.Header.ContentType())
// Parse body accordingly
if strings.HasPrefix(ctype, MIMEApplicationJSON) {