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

Custom favicon placed in static resources doesn't work since 2.2.0.M5 #17922

Closed
vpavic opened this issue Aug 20, 2019 · 3 comments
Closed

Custom favicon placed in static resources doesn't work since 2.2.0.M5 #17922

vpavic opened this issue Aug 20, 2019 · 3 comments
Assignees
Labels
type: regression A regression from a previous release
Milestone

Comments

@vpavic
Copy link
Contributor

vpavic commented Aug 20, 2019

After upgrading to Spring Boot 2.2.0.M5 custom favicon placed in src/main/resources/static/favicon.ico stopped working, and Boot's default favicon is returned instead.

At quick glance, I suspect this is a regression caused by #17318. It seems unintended, as this comment states that:

A custom favicon placed somewhere beneath a static resources location will also continue to work as it did before.

Which isn't the case, unless I misunderstood something.

This can be easily reproduced with a minimal application using just spring-boot-starter-web and having custom favicon placed in src/main/resources/static/favicon.ico. Downgrading to 2.2.0.M4 restores the expected behavior.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 20, 2019
@wilkinsona wilkinsona added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 21, 2019
@wilkinsona wilkinsona self-assigned this Aug 21, 2019
@wilkinsona
Copy link
Member

When fixing #17318, I was too focused on the nested case, GET /explorer/favicon.ico for example, and did not consider the simpler and more common case of GET /favicon.ico. This simpler case is a direct match for the favicon.ico resource handler mapping to classpath:favicon.ico so the favicon found by the classpath, typically Boot's, is always returned.

@wilkinsona wilkinsona added this to the 2.2.0.M6 milestone Aug 21, 2019
@wilkinsona
Copy link
Member

Thanks for trying out M5, @vpavic. This should now be fixed on master. You should be able to work around the problem with M5 by moving your favicon.ico into src/main/resources so that it can be found at the root of the classpath. Alternatively, you could set spring.mvc.favicon.enabled=false.

@vpavic
Copy link
Contributor Author

vpavic commented Aug 21, 2019

Thanks for the prompt fix @wilkinsona. I did workaround this by disabling default favicon through environment. I'll give snapshot a try later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
Development

No branches or pull requests

3 participants