Sha256: 1d975516f112537e5d8a3cf61f352158e9f9582d39e060c6e1dccfa09d4b0c25
Contents?: true
Size: 425 Bytes
Versions: 18
Compression:
Stored size: 425 Bytes
Contents
module Merb module Rack class ContentLength < Merb::Rack::Middleware 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
18 entries across 18 versions & 3 rubygems