Class: Bowtie::Middleware::Static
- Inherits:
-
Object
- Object
- Bowtie::Middleware::Static
- Defined in:
- lib/bowtie/middleware/static.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options) ⇒ Static
constructor
A new instance of Static.
Constructor Details
#initialize(app, options) ⇒ Static
Returns a new instance of Static.
3 4 5 6 7 |
# File 'lib/bowtie/middleware/static.rb', line 3 def initialize(app, ) @app = app @options = @rack_static = Rack::Static.new(app, ) end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bowtie/middleware/static.rb', line 9 def call(env) status, response, headers = @rack_static.call(env) status = status.to_i if status != 200 && !status.between?(300, 399) return @app.call(env) else [status, response, headers] end end |