class Rack::ContentType
default.
When no content type argument is provided, “text/html” is the
use Rack::ContentType, “text/plain”
Builder Usage:
Sets the Content-Type header on responses which don’t have one.
def call(env)
def call(env) status, headers, body = @app.call(env) headers = Utils::HeaderHash[headers] unless STATUS_WITH_NO_ENTITY_BODY.key?(status.to_i) headers[CONTENT_TYPE] ||= @content_type end [status, headers, body] end
def initialize(app, content_type = "text/html")
def initialize(app, content_type = "text/html") @app, @content_type = app, content_type end