Parent

Methods

Class Index [+]

Quicksearch

Rack::ContentType

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.

Public Class Methods

new(app, content_type = "text/html") click to toggle source

(Not documented)

    # File lib/rack/content_type.rb, line 12
12:     def initialize(app, content_type = "text/html")
13:       @app, @content_type = app, content_type
14:     end

Public Instance Methods

call(env) click to toggle source

(Not documented)

    # File lib/rack/content_type.rb, line 16
16:     def call(env)
17:       status, headers, body = @app.call(env)
18:       headers = Utils::HeaderHash.new(headers)
19:       headers['Content-Type'] ||= @content_type
20:       [status, headers.to_hash, body]
21:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.