Skip to content

Commit

Permalink
Extract DROP_BODY_RESPONSES to a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
vipulnsward committed Jul 20, 2013
1 parent f607ffd commit fef89bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def method_missing(*args, &block)
# http://rack.rubyforge.org/doc/classes/Rack/Response.html
# http://rack.rubyforge.org/doc/classes/Rack/Response/Helpers.html
class Response < Rack::Response
DROP_BODY_RESPONSES = [204, 205, 304]
def initialize(*)
super
headers['Content-Type'] ||= 'text/html'
Expand Down Expand Up @@ -161,7 +162,7 @@ def drop_content_info?
end

def drop_body?
[204, 205, 304].include?(status.to_i)
DROP_BODY_RESPONSES.include?(status.to_i)
end
end

Expand Down

0 comments on commit fef89bd

Please sign in to comment.