lib/goliath/rack/validation/request_method.rb in goliath-0.9.4 vs lib/goliath/rack/validation/request_method.rb in goliath-1.0.0.beta.1
- old
+ new
@@ -19,10 +19,10 @@
# @param app The app object
# @param methods [Array] The accepted request methods
# @return [Goliath::Rack::Validation::RequestMethod] The validator
def initialize(app, methods = [])
@app = app
- @methods = methods
+ @methods = Array(methods)
end
def call(env)
return validation_error(405, ERROR, "Allow" => methods.map{|m| m.to_s.upcase}.join(', ')) unless methods.include?(env['REQUEST_METHOD'])
@app.call(env)
\ No newline at end of file