Created
August 13, 2009 18:50
-
-
Save metavida/167384 to your computer and use it in GitHub Desktop.
A simple patch of the mongrel_upload_progress gem that allows us to use regular expressions in the :path_info parameter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- lib/mongrel_upload_progress/init.rb | |
+++ lib/mongrel_upload_progress/init.rb | |
@@ -32,8 +32,8 @@ | |
private | |
def upload_notify(action, params, *args) | |
- return unless @path_info.include?(params['PATH_INFO']) && | |
- params[Mongrel::Const::REQUEST_METHOD] == 'POST' && | |
+ return unless params[Mongrel::Const::REQUEST_METHOD] == 'POST' && | |
+ @path_info.detect { |r| r.is_a?(Regexp) ? r =~ params['PATH_INFO'] : r == params['PATH_INFO'] } && | |
upload_id = Mongrel::HttpRequest.query_parse(params['QUERY_STRING'])['upload_id'] | |
if action == :mark | |
last_checked_time = Mongrel::Uploads.last_checked(upload_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment