The Wayback Machine - https://web.archive.org/web/20220317080653/https://github.com/go-gitea/gitea/issues/19109
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

Favicon not used when viewing files #19109

Open
FWDekker opened this issue Mar 16, 2022 · 2 comments
Open

Favicon not used when viewing files #19109

FWDekker opened this issue Mar 16, 2022 · 2 comments

Comments

@FWDekker
Copy link
Contributor

@FWDekker FWDekker commented Mar 16, 2022

Gitea Version

1.15.9

Operating System

FreeBSD 13

Browser Version

Firefox 98.0

Can you reproduce the bug on the Gitea demo site?

No

Description

Cannot reproduce at try.gitea.io because it does not use a non-standard favicon. See this file on my self-hosted Gitea instance as an example.

When looking at a file directly in the browser, such as an avatar or PDF file, the default favicon is used instead of the custom favicon. At least in Firefox, the browser displays the favicon at example.com/favicon.ico when viewing a file. On HTML pages, the browser correctly uses example.com/assets/img/logo.svg.

I have configured the favicon by adding the files favicon.ico, favicon.png, logo.png, and logo.svg to $GITEA_CUSTOM/public/img/.

Screenshots

Two tabs showing different favicons for the same Gitea instance.

On the left: correct favicon is used for an HTML page.
On the right: default favicon is used for an image.

@silverwind
Copy link
Member

@silverwind silverwind commented Mar 16, 2022

Favicons are now SVG, so /favicon.ico route is unused and it redirects to root. It might be possible to redirect /favicon.ico to /assets/img/logo.svg file in case the browser would accept that. Or possible just serve the SVG on that route directly.

@techknowlogick
Copy link
Member

@techknowlogick techknowlogick commented Mar 16, 2022

Probably a redirect would be better so that browsers don't hit both and cache both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants