Sha256: 48efe913b6e5d867e6db8541800c320756f11e8b47a419bc198f2f16347efe6e
Contents?: true
Size: 405 Bytes
Versions: 42
Compression:
Stored size: 405 Bytes
Contents
module Rack class Head # Rack::Head returns an empty body for all HEAD requests. It leaves # all other requests unchanged. def initialize(app) @app = app end def call(env) status, headers, body = @app.call(env) if env["REQUEST_METHOD"] == "HEAD" body.close if body.respond_to? :close [status, headers, []] else [status, headers, body] end end end end
Version data entries
42 entries across 37 versions & 11 rubygems