Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix String status check failed at STATUS_WITH_NO_ENTITY_BODY #1275

Merged
merged 1 commit into from May 15, 2018

Conversation

yeuem1vannam
Copy link
Contributor

Since the STATUS_WITH_NO_ENTITY_BODY is an array of Integer, the check at lib/rack/lint.rb and lib/rack/content_length.rb allows to check the String status by calling to_i, but other places do not.

For example:

unless STATUS_WITH_NO_ENTITY_BODY.include?(status)
headers[CONTENT_TYPE] ||= @content_type
end

Fixed to allow String status for:

  • lib/rack/content_type.rb
  • lib/rack/chunked.rb
  • lib/rack/deflater.rb

Resolves #1218

Since the `STATUS_WITH_NO_ENTITY_BODY` is an array of Integer, the check
at lib/rack/lint.rb and lib/rack/content_length.rb allows to check the
String status by calling `to_i`, but other places do not.
Fixed to use the same behaviour for
- lib/rack/content_type.rb
- lib/rack/chunked.rb
- lib/rack/deflater.rb
@tenderlove tenderlove merged commit 42e4801 into rack:master May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants