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

Fix two favicon issues #1139

Merged
merged 1 commit into from
Jul 6, 2023
Merged

Fix two favicon issues #1139

merged 1 commit into from
Jul 6, 2023

Conversation

falkoschindler
Copy link
Contributor

This PR fixes the following two issues regarding favicons:

  1. The following code should use logo.png as favicon on "/":

    @ui.page('/', favicon='website/static/logo.png')
    def test():
        ui.label('The default favicon is used instead of logo.png!')
    
    ui.run()

    But the route is incorrectly created at "//favicon.ico". By explicitly handling the index path "/" in create_favicon_route(), this bug is easily fixed.

  2. The following code should use logo.png as favicon on "/test":

    @ui.page('/test')
    def test():
        ui.label('The favicon is not served.')
    
    ui.run(favicon='website/static/logo.png')

    But there is no favicon route created for "/test", because the page favicon is None. Instead the global favicon should be used. This is fixed by ignoring the page path in get_favicon_url() in this case.

@falkoschindler falkoschindler requested a review from rodja July 6, 2023 16:27
@falkoschindler falkoschindler added the bug Something isn't working label Jul 6, 2023
@falkoschindler falkoschindler added this to the 1.3.0 milestone Jul 6, 2023
@rodja rodja merged commit ffeefec into main Jul 6, 2023
@rodja rodja deleted the favicon branch July 6, 2023 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants