-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize basicauth allocations #2333
Conversation
Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
Can you post benchmark results here (old, new) |
Before (current master)
After (this PR)
As I see, if auth header like |
Can you use https://github.com/gofiber/fiber/blob/master/utils/strings.go#L65 and send results again. (Also utils.ToLower) |
With utils.EqualFold
With utils.ToLower
Update PR for use utils.EqualFold ? |
sure |
Done. If you plan to merge, may be better squash commit on merge ? |
Don't need it. We're already merging squashed commits into the master |
Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
Description
Fix for test basic header as described in RFC 7617, like
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Also avoid string buffer alloc in
strings.ToLower
if string not in lower case, likeBasic
Fixes # (issue)
Type of change
Please delete options that are not relevant.