Merge pull request #1398 from iguchi1124/remove-205-from-drop-body-responses
Remove status code 205 from drop body responses
This commit is contained in:
commit
26e375aaac
|
@ -132,7 +132,7 @@ module Sinatra
|
|||
# http://rubydoc.info/github/rack/rack/master/Rack/Response
|
||||
# http://rubydoc.info/github/rack/rack/master/Rack/Response/Helpers
|
||||
class Response < Rack::Response
|
||||
DROP_BODY_RESPONSES = [204, 205, 304]
|
||||
DROP_BODY_RESPONSES = [204, 304]
|
||||
def initialize(*)
|
||||
super
|
||||
headers['Content-Type'] ||= 'text/html'
|
||||
|
|
|
@ -8,7 +8,7 @@ class HelpersTest < Minitest::Test
|
|||
end
|
||||
|
||||
def status_app(code, &block)
|
||||
code += 2 if [204, 205, 304].include? code
|
||||
code += 2 if [204, 304].include? code
|
||||
block ||= proc { }
|
||||
mock_app do
|
||||
get('/') do
|
||||
|
|
|
@ -27,7 +27,7 @@ class ResponseTest < Minitest::Test
|
|||
assert_equal 'Hello World', @response.body.join
|
||||
end
|
||||
|
||||
[204, 205, 304].each do |status_code|
|
||||
[204, 304].each do |status_code|
|
||||
it "removes the Content-Type header and body when response status is #{status_code}" do
|
||||
@response.status = status_code
|
||||
@response.body = ['Hello World']
|
||||
|
|
Loading…
Reference in New Issue