Sets the Content-Type header on responses which don’t have one.
Builder Usage:
use Rack::ContentType, "text/plain"
When no content type argument is provided, “text/html“ is assumed.
# File lib/rack/content_type.rb, line 18 18: def call(env) 19: status, headers, body = @app.call(env) 20: headers = Utils::HeaderHash.new(headers) 21: 22: unless STATUS_WITH_NO_ENTITY_BODY.include?(status) 23: headers['Content-Type'] ||= @content_type 24: end 25: 26: [status, headers, body] 27: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.