Permalink
Browse files

Make that nil instead of []. Makes better sense

  • Loading branch information...
1 parent b0ee3b6 commit 3701dc1c8c7bd7154c470de54aa66292043b9f24 @pablobm pablobm committed Jul 29, 2010
Showing with 2 additions and 7 deletions.
  1. +2 −7 lib/rack/raw_upload.rb
View
@@ -4,20 +4,15 @@ class RawUpload
def initialize(app, opts = {})
@app = app
@paths = opts[:paths]
- case @paths
- when String
- @paths = [@paths]
- when nil
- @paths = []
- end
+ @paths = [@paths] if @paths.kind_of?(String)
end
def call(env)
raw_file_post?(env) ? convert_and_pass_on(env) : @app.call(env)
end
def upload_path?(request_path)
- return true if @paths.empty?
+ return true if @paths.nil?
@paths.any? do |candidate|
literal_path_match?(request_path, candidate) || wildcard_path_match?(request_path, candidate)

0 comments on commit 3701dc1

Please sign in to comment.