Class: Shotgun::SkipFavicon

Inherits:
Struct
  • Object
show all
Defined in:
lib/shotgun/favicon.rb

Overview

Responds to requests for /favicon.ico with a content free 404 and caching headers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#appObject

Returns the value of attribute app



4
5
6
# File 'lib/shotgun/favicon.rb', line 4

def app
  @app
end

Instance Method Details

#call(env) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/shotgun/favicon.rb', line 5

def call(env)
  if env['PATH_INFO'] == '/favicon.ico'
    [404, {
      'Content-Type'  => 'image/png',
      'Cache-Control' => 'public, max-age=100000000000'
    }, []]
  else
    app.call(env)
  end
end