class Da99_Rack_Protect::Root_Favicon_If_Not_Found

Constants

NON_ROOT_ICO
ROOT_ICO

Public Class Methods

new(new_app) click to toggle source
# File lib/da99_rack_protect/0040_Root_Favicon_If_Not_Found.rb, line 7
def initialize new_app
  @app = new_app
end

Public Instance Methods

call(e) click to toggle source
# File lib/da99_rack_protect/0040_Root_Favicon_If_Not_Found.rb, line 11
def call e
  status, headers, body = @app.call( e )
  return [status, headers, body] unless status == 404 && e['PATH_INFO'][NON_ROOT_ICO]
  DA99.redirect ROOT_ICO, 302 # Permanent
end