mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-23 01:43:54 +00:00
⚡Improve ctx.BodyParser speed -> remove toLower
This commit is contained in:
parent
778c035767
commit
165b0b6107
2
ctx.go
2
ctx.go
@ -235,7 +235,7 @@ func (ctx *Ctx) BodyParser(out interface{}) error {
|
|||||||
defer decoderPool.Put(schemaDecoder)
|
defer decoderPool.Put(schemaDecoder)
|
||||||
|
|
||||||
// Get content-type
|
// Get content-type
|
||||||
ctype := utils.ToLower(getString(ctx.Fasthttp.Request.Header.ContentType()))
|
ctype := getString(ctx.Fasthttp.Request.Header.ContentType())
|
||||||
|
|
||||||
// Parse body accordingly
|
// Parse body accordingly
|
||||||
if strings.HasPrefix(ctype, MIMEApplicationJSON) {
|
if strings.HasPrefix(ctype, MIMEApplicationJSON) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user