Skip to content
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

Refactor favicon middleware, avoid magic numbers. #1919

Merged
merged 2 commits into from May 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion middleware/favicon/favicon.go
Expand Up @@ -97,7 +97,8 @@ func New(config ...Config) fiber.Handler {
}

// Only respond to favicon requests
if len(c.Path()) != 12 || c.Path() != "/favicon.ico" {
standardPath := "/favicon.ico"
if len(c.Path()) != len(standardPath) || c.Path() != standardPath {
return c.Next()
}

Expand Down