[Jifty-commit] r5242 - in jifty/trunk: lib/Jifty/Plugin/REST

Jifty commits jifty-commit at lists.jifty.org
Thu Mar 27 12:52:43 EDT 2008


Author: sterling
Date: Thu Mar 27 12:52:43 2008
New Revision: 5242

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/Makefile.PL
   jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm

Log:
 r15759 at andrew-mac:  andrew | 2008-03-27 11:48:03 -0500
 Updating the REST plugin to use PUTDATA added in CGI.pm 3.30.


Modified: jifty/trunk/Makefile.PL
==============================================================================
--- jifty/trunk/Makefile.PL	(original)
+++ jifty/trunk/Makefile.PL	Thu Mar 27 12:52:43 2008
@@ -10,7 +10,7 @@
 requires('Class::Data::Inheritable');
 requires('Class::Trigger' => '0.12');
 requires('Clone' => '0.27');
-requires('CGI' => '3.19');
+requires('CGI' => '3.30');
 requires('CGI::Cookie::Splitter');
 requires('Class::Inspector' => 1.20); # For File::ShareDir on Win32
 requires('Crypt::CBC');

Modified: jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm	Thu Mar 27 12:52:43 2008
@@ -737,19 +737,15 @@
             if defined $rec->id;
     }
     
-    # CGI.pm doesn't handle form encoded data in PUT requests (in fact,
-    # it doesn't really handle PUT requests properly at all), so we have
-    # to read the request body ourselves and have CGI.pm parse it
+    # CGI.pm doesn't handle form encoded data in PUT requests, so we have
+    # to read the request body from PUTDATA and have CGI.pm parse it
     if (    $ENV{'REQUEST_METHOD'} eq 'PUT'
         and (   $ENV{'CONTENT_TYPE'} =~ m|^application/x-www-form-urlencoded$|
               or $ENV{'CONTENT_TYPE'} =~ m|^multipart/form-data$| ) )
     {
         my $cgi    = Jifty->handler->cgi;
         my $length = defined $ENV{'CONTENT_LENGTH'} ? $ENV{'CONTENT_LENGTH'} : 0;
-        my $data;
-
-        $cgi->read_from_client( \$data, $length, 0 )
-            if $length > 0;
+        my $data = $cgi->param('PUTDATA');
 
         if ( defined $data ) {
             my @params = $cgi->all_parameters;


More information about the Jifty-commit mailing list