[ 'file' => ["$FindBin::Bin/catalyst_130pix.gif"], ]
);
- # Sending wrong Content-Length here and see if subequent requests fail
- $request->header('Content-Length' => $request->header('Content-Length') + 1);
+ # LWP will auto-correct Content-Length when using a remote server
+ SKIP:
+ {
+ if ( $ENV{CATALYST_SERVER} ) {
+ skip 'Using remote server', 2;
+ }
- ok( my $response = request($request), 'Request' );
- ok( !$response->is_success, 'Response Error' );
+ # Sending wrong Content-Length here and see if subequent requests fail
+ $request->header('Content-Length' => $request->header('Content-Length') + 1);
+
+ ok( my $response = request($request), 'Request' );
+ ok( !$response->is_success, 'Response Error' );
+ }
$request = POST(
'http://localhost/dump/request',
'file2' => ["$FindBin::Bin/catalyst_130pix.gif"], ]
);
- ok( $response = request($request), 'Request' );
+ 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/file1 => bless/, 'Upload with name file1');
use Test::More tests => 3;
use Catalyst::Test 'TestApp';
-ok( my $response = request('http://localhost/loop_test'), 'Request' );
-ok( $response->is_success, 'Response Successful 2xx' );
-ok( $response->header('X-Class-Forward-Test-Method'), 'Loop OK' );
+SKIP:
+{
+ # Net::HTTP::Methods crashes when talking to a remote server because this
+ # test causes a very long header line to be sent
+ if ( $ENV{CATALYST_SERVER} ) {
+ skip 'Using remote server', 3;
+ }
+
+ ok( my $response = request('http://localhost/loop_test'), 'Request' );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ ok( $response->header('X-Class-Forward-Test-Method'), 'Loop OK' );
+}
local $^W = 0;
-ok( my $response = request('http://localhost/recursion_test'), 'Request' );
-ok( !$response->is_success, 'Response Not Successful' );
-is( $response->header('X-Catalyst-Error'), 'Deep recursion detected calling "/recursion_test"', 'Deep Recursion Detected' );
+SKIP:
+{
+ # Net::HTTP::Methods crashes when talking to a remote server because this
+ # test causes a very long header line to be sent
+ if ( $ENV{CATALYST_SERVER} ) {
+ skip 'Using remote server', 3;
+ }
+
+ ok( my $response = request('http://localhost/recursion_test'), 'Request' );
+ ok( !$response->is_success, 'Response Not Successful' );
+ is( $response->header('X-Catalyst-Error'), 'Deep recursion detected calling "/recursion_test"', 'Deep Recursion Detected' );
+}