-
-
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
PR: add url for favicon middleware, for correct handling different of… #2231
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 |
Add pr Description according to pull request template. |
Shouldn't the file be cached using sync.Once? |
Sorry, I did not understand, what I should do? Use sync.once? |
i didn't change any cache behaviour in this pr. please explain where i should add sync.once? |
I'll try to take a look at the pull request tomorrow, if I know what he means or have other comments I'll let you know |
My mistake. I thought the middleware's job was to return a (cached) binary version of the favicon. |
@0xdeface couldn't you save the internal configuration switch by specifying the route when using the middleware ? example app.Use("/favicon.svg", favicon.New()) or app.Use("/favicon.:ext", favicon.New()) you could make this feature much more usable and would only have to deactivate the internal matching in such a case. |
Also make sure to update |
@0xdeface Hi can check the last comments and suggestions for improvement hope we can still customize it so that we provide this feature in the next version |
Hi, i will check comments and put changes on next week. |
@0xdeface did you get a chance to work on this so far? 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please consider suggestion by @leonklingele
@leonklingele can you check the PR again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, good work @0xdeface! 🥳
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
Presently ico url might be only /favicon.ico but some resource wants url exactly /favicon.svg for svg format.
I added new property to favicon config and default value with /favicon.ico. Also i changed docs for this middleware
Type of change
Checklist:
Commit formatting:
Use emojis on commit messages so it provides an easy way of identifying the purpose or intention of a commit. Check out the emoji cheatsheet here: https://gitmoji.carloscuesta.me/