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

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -