Class: Rack::BounceFavicon
- Inherits:
-
Object
- Object
- Rack::BounceFavicon
- Defined in:
- lib/rack/contrib/bounce_favicon.rb
Overview
Bounce those annoying favicon.ico requests
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ BounceFavicon
constructor
A new instance of BounceFavicon.
Constructor Details
#initialize(app) ⇒ BounceFavicon
Returns a new instance of BounceFavicon.
4 5 6 |
# File 'lib/rack/contrib/bounce_favicon.rb', line 4 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/rack/contrib/bounce_favicon.rb', line 8 def call(env) if env["PATH_INFO"] == "/favicon.ico" [404, {"Content-Type" => "text/html", "Content-Length" => "0"}, []] else @app.call(env) end end |