Skip to content

Won't work with Rails 3.0.x because of Rack 1.2.x bug #63

@seamusabshere

Description

@seamusabshere

Problem

  1. If you use Rails 3.0.12, you are stuck with Rack 1.2.5
  2. Rack 1.2.5 blows up if env['CONTENT_TYPE'] == "" and you call Rack::Request#media_type (or any other method that calls it, such as the very common pattern Rack::Request.new(env).params) per a bug that was fixed in later versions
  3. At the same time, Rack::Lint complains if you set env['CONTENT_TYPE'] to nil.

Possible solution

I think unicorn (accidentially? intentionally?) solves this by defaulting to text/html... but I could be wrong:

# https://github.com/defunkt/unicorn/blob/master/lib/unicorn/cgi_wrapper.rb#L95
@head[CONTENT_TYPE] ||= "text/html"

So puma could default to text/html (?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions