[Jifty-commit] jifty branch, plack, updated. 872a240aac9ae9af9614cb3f3a8df17cd2d9dbf7

Jifty commits jifty-commit at lists.jifty.org
Fri Jan 29 10:47:45 EST 2010


The branch, plack has been updated
       via  872a240aac9ae9af9614cb3f3a8df17cd2d9dbf7 (commit)
       via  37d18caaa2b746fa126db1a9f07a632cb44a7fe8 (commit)
      from  0b88a469f8f8e5b7fd1576d2521379753697c32b (commit)

Summary of changes:
 lib/Jifty/Request.pm        |    2 +-
 lib/Jifty/Web/FileUpload.pm |    5 ++++-
 t/Jifty.pm                  |    3 +--
 3 files changed, 6 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 37d18caaa2b746fa126db1a9f07a632cb44a7fe8
Author: Chia-liang Kao <clkao at clkao.org>
Date:   Fri Jan 29 23:34:52 2010 +0800

    Plack::Request::Upload no longer provides fh.

diff --git a/lib/Jifty/Web/FileUpload.pm b/lib/Jifty/Web/FileUpload.pm
index 5f24fba..032f4d4 100644
--- a/lib/Jifty/Web/FileUpload.pm
+++ b/lib/Jifty/Web/FileUpload.pm
@@ -134,7 +134,10 @@ sub new_from_plack {
     my $self = shift;
     my $u    = shift;
 
-    $self->new(filehandle   => $u->fh,
+    open my $fh, '<:raw', $u->tempname
+        or die "Can't open '@{[ $u->tempname ]}': '$!'";
+
+    $self->new(filehandle   => $fh,
                filename     => $u->filename,
                content_type => $u->type,
            );

commit 872a240aac9ae9af9614cb3f3a8df17cd2d9dbf7
Author: Chia-liang Kao <clkao at clkao.org>
Date:   Fri Jan 29 23:35:22 2010 +0800

    Default request parameters to empty hashref.

diff --git a/lib/Jifty/Request.pm b/lib/Jifty/Request.pm
index 744fc39..8ba87c6 100644
--- a/lib/Jifty/Request.pm
+++ b/lib/Jifty/Request.pm
@@ -16,7 +16,7 @@ has 'future_continuation_id' => (is => 'rw');
 has 'continuation_type' => (is => 'rw');
 has 'continuation_path' => (is => 'rw');
 
-has 'parameters' => (is => 'rw', isa => 'HashRef');
+has 'parameters' => (is => 'rw', isa => 'HashRef', default => sub { {} });
 has 'uploads' => (is => 'rw', isa => 'HashRef');
 has 'headers' => (is => 'rw', isa => 'HTTP::Headers', default => sub { HTTP::Headers->new });
 has 'uri' => (is => 'rw', isa => 'URI', default => sub { URI->new('http:///') });
diff --git a/t/Jifty.pm b/t/Jifty.pm
index 428a7e9..78c9828 100644
--- a/t/Jifty.pm
+++ b/t/Jifty.pm
@@ -16,8 +16,7 @@ use Test::Base::Filter -Base;
 sub request_from_webform {
     my $form = shift;
     my $r = Jifty::Request->new->from_webform(%$form);
-    delete $r->{env};
-    delete $r->{headers};
+    delete $r->{$_} for qw(env headers parameters);
     return $r;
 }
 

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list