Refactor pinned response logic

This commit is contained in:
Jordan Owens 2020-03-20 09:52:58 -04:00
parent 05ee1229dc
commit c47b74636d
1 changed files with 1 additions and 3 deletions

View File

@ -172,8 +172,6 @@ module Sinatra
def finish
result = body
headers.delete "Content-Type" if headers["Content-Type"].nil?
if drop_content_info?
headers.delete "Content-Length"
headers.delete "Content-Type"
@ -1008,7 +1006,7 @@ module Sinatra
def route!(base = settings, pass_block = nil)
if routes = base.routes[@request.request_method]
routes.each do |pattern, conditions, block|
@response['Content-Type'] = nil unless @pinned_response
@response.delete_header('Content-Type') unless @pinned_response
returned_pass_block = process_route(pattern, conditions) do |*args|
env['sinatra.route'] = "#{@request.request_method} #{pattern}"