Permalink
Browse files

Bounce those annoying favicon requests

  • Loading branch information...
josh committed Dec 11, 2008
1 parent f2169bd commit 1e55d85e5f96dff9187ede31c0100e000d2496ff
Showing with 17 additions and 0 deletions.
  1. +16 −0 lib/rack/bounce_favicon.rb
  2. +1 −0 lib/rack/contrib.rb
View
@@ -0,0 +1,16 @@
+module Rack
+ # Bounce those annoying favicon.ico requests
+ class BounceFavicon
+ def initialize(app)
+ @app = app
+ end
+
+ def call(env)
+ if env["PATH_INFO"] == "/favicon.ico"
+ [404, {"Content-Type" => "text/html", "Content-Length" => "0"}, []]
+ else
+ @app.call(env)
+ end
+ end
+ end
+end
View
@@ -6,6 +6,7 @@ def self.release
end
end
+ autoload :BounceFavicon, "rack/bounce_favicon"
autoload :ETag, "rack/etag"
autoload :JSONP, "rack/jsonp"
autoload :LighttpdScriptNameFix, "rack/lighttpd_script_name_fix"

0 comments on commit 1e55d85

Please sign in to comment.