Skip Menu |
 

This queue is for tickets about the Catalyst-Runtime CPAN distribution.

Report information
The Basics
Id: 22540
Status: resolved
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: Nobody in particular
Requestors: jonasbn [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 5.7001
Fixed in: (no value)



Subject: Config and Catalyst::Request::Upload
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain; charset="utf8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 176
Download (untitled) / with headers
text/plain 176b
The POD indicates it is possible to set a temporary directory for use with Catalyst::Request::Upload in Catalyst::Request::Upload. This does however not seem to work. jonasbn
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-32634-1211807002-1207.22540-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 225
Download (untitled) / with headers
text/plain 225b
On Tue Oct 24 08:23:03 2006, JONASBN wrote: Show quoted text
> The POD indicates it is possible to set a temporary directory for use with > Catalyst::Request::Upload in Catalyst::Request::Upload.
Can you provide us with a failing test case?
MIME-Version: 1.0 (Apple Message framework v924)
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00,DK_SIGNED,SPF_PASS
In-Reply-To: <rt-3.6.HEAD-32634-1211807002-1207.22540-6-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.924)
References: <RT-Ticket-22540 [...] rt.cpan.org> <rt-3.6.HEAD-32634-1211807002-1207.22540-6-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"; delsp="yes"; format="flowed"
X-RT-Original-Encoding: utf-8
Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id C98364D80C1 for <bug-Catalyst-Runtime [...] rt.cpan.org>; Tue, 17 Jun 2008 15:51:10 -0400 (EDT)
Received: (qmail 30245 invoked from network); 17 Jun 2008 19:51:09 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 17 Jun 2008 19:51:09 -0000
Received: from py-out-1112.google.com (HELO py-out-1112.google.com) (64.233.166.177) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jun 2008 12:51:05 -0700
Received: by py-out-1112.google.com with SMTP id u52so2177905pyb.11 for <bug-Catalyst-Runtime [...] rt.cpan.org>; Tue, 17 Jun 2008 12:51:02 -0700 (PDT)
Received: by 10.114.132.5 with SMTP id f5mr8504069wad.201.1213732261413; Tue, 17 Jun 2008 12:51:01 -0700 (PDT)
Received: from ?10.0.1.2? ( [83.89.200.10]) by mx.google.com with ESMTPS id l30sm9474369waf.25.2008.06.17.12.50.59 (version=SSLv3 cipher=RC4-MD5); Tue, 17 Jun 2008 12:51:00 -0700 (PDT)
Delivered-To: cpan-bug+Catalyst-Runtime [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #22540] Config and Catalyst::Request::Upload
Domainkey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=JXJIItJeJil289TD2ECh05/Kg7CBJ6PullwBTBn9cCvELQgN+OCSk26J+9zNgl/37w nlOpCes8tag6v1rMufobAk1pSQf98lqd7aQ1msQ1gBkt9poa7d+kHA9AS1DUzpCr5QzN +gKxAbeS08Yt6OP4OvnT+e00FdillT0alRGa4=
Return-Path: <jonasbn [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=bpvlbWnTMN+YNhopTcQjpNs1H/OhvwTzTx/5CfAjYLY=; b=x09mqsmzmJ4ew4iSvmz6sjK8E+HmGY/2yWbD9sFcgpxO8h4EQxn7WI7yllRo8Du441 LAG7nW5PyGdqV9bZWWZQPoS+j3UXoqk/4AawZ6QnwfcahadyQEWUfguXHxAV8ItD1b3y tsKtj21nCeNwCAyzv5U24+FNmz1qMaTb+k4FY=
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Catalyst-Runtime [...] rt.cpan.org
Date: Tue, 17 Jun 2008 21:50:56 +0200
X-Spam-Level: *
Message-Id: <4247F780-FD8F-49C0-84F1-D87C6880E73B [...] gmail.com>
To: bug-Catalyst-Runtime [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Jonas Brømsø Nielsen <jonasbn [...] gmail.com>
RT-Message-ID: <rt-3.6.HEAD-2064-1213984505-1242.22540-0-0 [...] rt.cpan.org>
Content-Length: 468
Download (untitled) / with headers
text/plain 468b
Hello Brian, No I am sorry, I am no longer working on the project - and I have moved on. Thanks, jonasbn On 26/05/2008, at 15.03, Brian Cassidy via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=22540 > > > On Tue Oct 24 08:23:03 2006, JONASBN wrote:
>> The POD indicates it is possible to set a temporary directory for >> use with >> Catalyst::Request::Upload in Catalyst::Request::Upload.
> > Can you provide us with a failing test case? >
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Charset: utf8
Message-Id: <rt-3.6.HEAD-2172-1213992169-425.22540-0-0 [...] rt.cpan.org>
Content-Type: multipart/mixed; boundary="----------=_1213992170-2172-20"
X-RT-Original-Encoding: utf-8
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 62
Attached is an updated test that, i think, proves the failure.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Type: multipart/mixed; boundary="----------=_1213992169-2172-19"
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: text/x-diff; name="uploadtmp.patch"
Content-Disposition: inline; filename="uploadtmp.patch"
Content-Transfer-Encoding: binary
Content-Length: 2258
Download uploadtmp.patch
text/x-diff 2.2k
=== t/live_engine_request_uploads.t ================================================================== --- t/live_engine_request_uploads.t (revision 34689) +++ t/live_engine_request_uploads.t (local) @@ -6,7 +6,7 @@ use FindBin; use lib "$FindBin::Bin/lib"; -use Test::More tests => 75; +use Test::More tests => 88; use Catalyst::Test 'TestApp'; use Catalyst::Request; @@ -242,3 +242,62 @@ is( $upload->filename, 'catalyst_130pix.gif' ); } } + +# test uploadtmp config var + +{ + my $creq; + + my $dir = "$FindBin::Bin/"; + local TestApp->config->{ uploadtmp } = $dir; + + my $request = POST( + 'http://localhost/dump/request/', + 'Content-Type' => 'multipart/form-data', + 'Content' => [ + 'testfile' => ["$FindBin::Bin/live_engine_request_uploads.t"], + ] + ); + + ok( my $response = request($request), 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + + { + no strict 'refs'; + ok( + eval '$creq = ' . $response->content, + 'Unserialize Catalyst::Request' + ); + } + + isa_ok( $creq, 'Catalyst::Request' ); + is( $creq->method, 'POST', 'Catalyst::Request method' ); + is( $creq->content_type, 'multipart/form-data', + 'Catalyst::Request Content-Type' ); + is( $creq->content_length, $request->content_length, + 'Catalyst::Request Content-Length' ); + + for my $part ( $request->parts ) { + + my $disposition = $part->header('Content-Disposition'); + my %parameters = @{ ( split_header_words($disposition) )[0] }; + + next unless exists $parameters{filename}; + + my $upload = $creq->{uploads}->{ $parameters{name} }; + + isa_ok( $upload, 'Catalyst::Request::Upload' ); + + is( $upload->type, $part->content_type, 'Upload Content-Type' ); + is( $upload->size, length( $part->content ), 'Upload Content-Length' ); + + like( $upload->tempname, qr{\Q$dir\E}, 'uploadtmp' ); + } +} +
MIME-Version: 1.0
X-Mailer: MIME-tools 5.426 (Entity 5.426)
Content-Disposition: inline
Charset: utf8
Message-Id: <rt-3.6.HEAD-20356-1214258534-891.22540-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 54
Fixed in svn revision 7995 (requires HTTP::Body 1.04).


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.