Parent

Camping::Server::XSendfile

Public Class Methods

new(app) click to toggle source
     # File lib/camping/server.rb, line 237
237:       def initialize(app)
238:         @app = app
239:       end

Public Instance Methods

call(env) click to toggle source
     # File lib/camping/server.rb, line 241
241:       def call(env)
242:         status, headers, body = @app.call(env)
243:         
244:         if key = headers.keys.grep(/X-Sendfile/).first
245:           filename = headers[key]
246:           content = open(filename,'rb') { | io | io.read}
247:           headers['Content-Length'] = size(content).to_s
248:           body = [content]
249:         end
250:         
251:         return status, headers, body
252:       end
size(str) click to toggle source
     # File lib/camping/server.rb, line 255
255:         def size(str)
256:           str.bytesize
257:         end
size(str) click to toggle source
     # File lib/camping/server.rb, line 259
259:         def size(str)
260:           str.size
261:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.