mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Use headers
instead of header
, since in Rack::Response
headers
is an alias for header
and headers
is widely used in Sinatra. It's confusing that in Sinatra::Response#finish
both headers
and header
.
This commit is contained in:
parent
f8c0385461
commit
9ce004f1cc
1 changed files with 2 additions and 2 deletions
|
@ -125,7 +125,7 @@ module Sinatra
|
|||
headers["Content-Length"] = body.inject(0) { |l, p| l + Rack::Utils.bytesize(p) }.to_s
|
||||
end
|
||||
|
||||
[status.to_i, header, result]
|
||||
[status.to_i, headers, result]
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -159,7 +159,7 @@ module Sinatra
|
|||
|
||||
private
|
||||
|
||||
def setup_close(env, status, header, body)
|
||||
def setup_close(env, status, headers, body)
|
||||
return unless body.respond_to? :close and env.include? 'async.close'
|
||||
env['async.close'].callback { body.close }
|
||||
env['async.close'].errback { body.close }
|
||||
|
|
Loading…
Add table
Reference in a new issue