Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #15 from dwbutler/master

Check for block_given? in initialization
  • Loading branch information...
commit 13782d90ebdaacd6cd12de46ff060d76c8842b3b 2 parents 68a7e3b + d985246
@cyu authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/rack/cors.rb
View
10 lib/rack/cors.rb
@@ -7,10 +7,12 @@ def initialize(app, opts={}, &block)
@logger = opts[:logger]
@debug_mode = !!opts[:debug]
- if block.arity == 1
- block.call(self)
- else
- instance_eval(&block)
+ if block_given?
+ if block.arity == 1
+ block.call(self)
+ else
+ instance_eval(&block)
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.