mirror of
https://github.com/gofiber/fiber.git
synced 2025-05-31 11:52:41 +00:00
⚡Improve ctx.Is performance
This commit is contained in:
parent
88b4da6a03
commit
aafa784bbb
2
ctx.go
2
ctx.go
@ -524,7 +524,7 @@ func (ctx *Ctx) Is(extension string) bool {
|
||||
}
|
||||
|
||||
return strings.HasPrefix(
|
||||
utils.TrimLeft(utils.GetString(utils.ToLowerBytes(ctx.Fasthttp.Request.Header.ContentType())), ' '),
|
||||
utils.TrimLeft(utils.GetString(ctx.Fasthttp.Request.Header.ContentType()), ' '),
|
||||
extensionHeader,
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user