rails favicon issues, negative route constraints -
when visit domain.com/favicon.ico
404's, localhost:3000/favicon.ico
renders favicon successfully.
i think it's catching on root parameter route because layout rendered differently generic 404 page when tried fake route /aliwejfl/aliwejf
.
get '/:nickname' => 'users#profile'
i know can whitelist mime types in route constraints:
constraints(format: 'html') # routes here end
but there way blacklist?
figured out when writing question. forgot regular expressions allowed.
constraints(format: /(?!ico)/) # routes end
that way get /not_favicon.ico
404.
Comments
Post a Comment