Parent

Methods

Innate::RackFileWrapper

Public Class Methods

new(root, cache_control = nil) click to toggle source
   # File lib/innate/rack_file_wrapper.rb, line 3
3:     def initialize(root, cache_control = nil)
4:       @file = Rack::File.new(root, cache_control)
5:     end

Public Instance Methods

call(env) click to toggle source
    # File lib/innate/rack_file_wrapper.rb, line 7
 7:     def call(env)
 8:       status, header, body = @file.call(env)
 9: 
10:       if status == 403
11:         unless Rack::File::ALLOWED_VERBS.include?(env['REQUEST_METHOD'])
12:           body = "File not Found: #{Rack::Utils.unescape(env['PATH_INFO'])}\n"
13:           return 404, {
14:             'Content-Type' => 'text/plain',
15:             'Content-Length' => body.size,
16:             'X-Cascade' => 'pass',
17:           }, [body]
18:         end
19:       end
20: 
21:       return status, header, body
22:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.