Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
More concise and idiomatic response destructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
samstokes committed Aug 10, 2011
1 parent 915e49a commit 92a3f8b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/rack/cors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def process_request(env, cors_headers)

if async
original_callback = env['async.callback']
env['async.callback'] = proc do |response|
status, headers, body = response
env['async.callback'] = proc do |status, headers, body|
headers = headers.merge(cors_headers) if cors_headers
original_callback.call([status, headers, body])
end
Expand Down

0 comments on commit 92a3f8b

Please sign in to comment.