diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-08-13 14:20:04 -0400 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-08-13 14:20:04 -0400 |
commit | 38a3fed404e5e4f5c03be6f5288848d6d4f5d98c (patch) | |
tree | 446dc7954c86db28eff3cc77d2716c752249a859 /actionpack/lib/action_dispatch | |
parent | 8f0541b702f023c3c0841a47747ba0c793fcbb17 (diff) | |
download | rails-38a3fed404e5e4f5c03be6f5288848d6d4f5d98c.tar.gz rails-38a3fed404e5e4f5c03be6f5288848d6d4f5d98c.tar.bz2 rails-38a3fed404e5e4f5c03be6f5288848d6d4f5d98c.zip |
push header merge down to a private method so that live responses can have their own header object
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 5014ad80aa..11b7534ea4 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -97,9 +97,7 @@ module ActionDispatch # :nodoc: def initialize(status = 200, header = {}, body = []) super() - if self.class.default_headers.respond_to?(:merge) - header = self.class.default_headers.merge(header) - end + header = merge_default_headers(header, self.class.default_headers) self.body, self.header, self.status = body, header, status @@ -243,6 +241,12 @@ module ActionDispatch # :nodoc: private + def merge_default_headers(original, default) + return original unless default.respond_to?(:merge) + + default.merge(original) + end + def build_buffer(response, body) Buffer.new response, body end |