-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Lucky couldn't figure out what format the client accepts. The client's Accept header: 'image/*;q=0.8' #986
Comments
Could you post back your page source? Specifically how you render favicon?
Without seeing that, I would venture that this maybe not related to Lucky per se. See: Firefox - List of default Accept values .
Can you try these two options
Also if you want to handle both PNG & ICO favicons
|
The website is Read Rust, the favicon is an ICO file, not PNG. I don't point at the favicon in my markup. I just rely on the default browser of looking for favicon.ico at the root of the domain, which is where this route maps to.
I'm not sure that's the case, I think it's looking for anything with an image mime type (
Does it make sense to include the quality factor ( |
My first guess is you have to tell the action which mimetype you want to use like: class Favicon::Show < BrowserAction
include Auth::AllowGuests
accepted_formats [:ico, :png], default: :ico
before cache_publicly(1.day)
get "/favicon.ico" do
file "public/favicon.ico", disposition: "inline"
end
end Otherwise it'll think you're returning HTML. You'll have to register those ico or png. Now my second though is, why do it in an action, and not in the view directly? My app is multi-tenant, so I need a differen favicon for each site, but I use this: # call this in the layout
def favicon_tag(path)
empty_tag("link", rel: "shortcut icon", href: dynamic_asset("images/#{path}"))
end |
Thanks, I'll give that a try.
I like not needing to add markup for this. Using dynamic asset would add a fingerprint to the path, and then it would not longer be at |
Fair enough. Always good to make sure alternate methods work out anyway 😄 |
I have the following action for handing the favicon. (I need to have it as its own action instead of it falling back to asset handing because I have have a catch all route
/:category
elsewhere in the application):When I access a page in Mobile Firefox on iOS and it requests the favicon, I see this error.
I tried adding
Lucky::MimeType.register "image/x-icon", :ico
to theconfig/mime_types.cr
as suggested but the error still occurs.Lucky: 0.18.0
Crystal: 0.31.0
The text was updated successfully, but these errors were encountered: