Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use `headers` method instead of `header` method in `Sinatra::Response` #659

Merged
merged 1 commit into from

2 participants

@patriciomacadden

Since headers is an alias for header (see Rack::Response) and headers is widely used in Sinatra. It's confusing that in Sinatra::Response#finish both headers and header are used.

And in Sinatra::ExtendedRack#setup_close use headers as parameter just like in Sinatra::ExtendedRack#async?

@patriciomacadden patriciomacadden 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`.
9ce004f
@rkh rkh merged commit 08effab into sinatra:master

1 check passed

Details default The Travis build passed
@patriciomacadden patriciomacadden deleted the patriciomacadden:header-headers branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 7, 2013
  1. @patriciomacadden

    Use `headers` instead of `header`, since in `Rack::Response` `headers…

    patriciomacadden authored
    …` 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 page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/sinatra/base.rb
View
4 lib/sinatra/base.rb
@@ -125,7 +125,7 @@ def finish
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 @@ def call(env)
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 }
Something went wrong with that request. Please try again.