Sha256: 73ac516ecddfe01f2f902d2f4cdeb4741b6ad32cea98150e9c3617b530965f35
Contents?: true
Size: 447 Bytes
Versions: 22
Compression:
Stored size: 447 Bytes
Contents
module Merb module Rack class ContentLength < Merb::Rack::Middleware # :api: plugin def call(env) status, headers, body = @app.call(env) # to_s is because Rack spec expects header # values to be iterable and yield strings header = 'Content-Length'.freeze headers[header] = body.size.to_s unless headers.has_key?(header) [status, headers, body] end end end end
Version data entries
22 entries across 22 versions & 1 rubygems