HTTP::Body 1.03, patch from ruoso to set body data for XForms v1.03
Andy Grundman [Mon, 7 Apr 2008 12:17:40 +0000 (12:17 +0000)]
Changes
lib/HTTP/Body.pm
lib/HTTP/Body/XForms.pm
lib/HTTP/Body/XFormsMultipart.pm
t/data/xforms/001-results.yml
t/data/xforms/002-results.yml

diff --git a/Changes b/Changes
index 01c20c5..5c95dc4 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 This file documents the revision history for Perl extension HTTP::Body.
 
+1.03    2008-04-07 08:20:00
+        - Set body value for XForms data. (Daniel Ruoso)
+
 1.02    2008-02-27 17:30:00
         - Fixed issue with urlencoded test on Windows.
 
index dce077e..7c1d5e0 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 
 use Carp       qw[ ];
 
-our $VERSION = '1.02';
+our $VERSION = '1.03';
 
 our $TYPES = {
     'application/octet-stream'          => 'HTTP::Body::OctetStream',
index 6365621..bdbd4a6 100644 (file)
@@ -34,12 +34,12 @@ the buffer content.
 
 sub spin {
     my $self = shift;
-    
+
+    $self->body($self->{buffer});
     $self->param( 'XForms:Model', $self->{buffer} );
-    
     $self->{buffer} = '';
     $self->{state}  = 'done';
-    
+
     return $self->SUPER::init();
 }
 
index 20a3693..66aff7b 100644 (file)
@@ -74,6 +74,9 @@ sub handler {
     
     if ( $contentid eq $self->start ) {
         $part->{name} = 'XForms:Model';
+        if ($part->{done}) {
+            $self->body($part->{data});
+        }
     }
     elsif ( defined $contentid ) {
         $part->{name}     = $contentid;
index 4cecad1..77c8d3f 100644 (file)
@@ -1,5 +1,5 @@
 ---
-body: ~
+body: <model><data1>asdfg</data1><data2>asdfg</data2></model>
 start: asdfg@asdfg.com
 param:
   XForms:Model: <model><data1>asdfg</data1><data2>asdfg</data2></model>
index 1b6b3bc..f5298ba 100644 (file)
@@ -1,5 +1,5 @@
 ---
-body: ~
+body: <model><data1>asdfg</data1><data2>asdfg</data2></model>
 param:
   XForms:Model: <model><data1>asdfg</data1><data2>asdfg</data2></model>
 upload: {}