lib/merb/merb_upload_handler.rb in merb-0.3.4 vs lib/merb/merb_upload_handler.rb in merb-0.3.7
- old
+ new
@@ -1,8 +1,9 @@
module Mongrel
module Const
POST = 'POST'.freeze unless const_defined?(:POST)
+ PUT = 'PUT'.freeze unless const_defined?(:PUT)
QUERY_STRING = 'QUERY_STRING'.freeze unless const_defined?(:QUERY_STRING)
UPLOAD_ID = 'upload_id'.freeze
end
unless ENV['EVENT'] || ENV['SWIFT']
@@ -70,10 +71,10 @@
Mongrel::Uploads.update_checked_time(upload_id) unless action == :finish
end
def valid_upload?(params)
@path_info.any? { |p| params[Mongrel::Const::PATH_INFO].include?(p) } &&
- params[Mongrel::Const::REQUEST_METHOD] == Mongrel::Const::POST &&
+ [Mongrel::Const::POST, Mongrel::Const::PUT].include?(params[Mongrel::Const::REQUEST_METHOD]) &&
Mongrel::HttpRequest.query_parse(params[Mongrel::Const::QUERY_STRING])[Mongrel::Const::UPLOAD_ID]
end
end