X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flive_engine_request_uploads.t;h=d0eeb7d20665b325e1888749590c75342b555fff;hp=bc437162c36ebc8f1719a6c9cbcada80b217d500;hb=09461385e3f0f62cbf3a95a71d00f71e1a42ca75;hpb=fdb3773e12efa92b61ce7e128ef0444f1d1b4e67 diff --git a/t/live_engine_request_uploads.t b/t/live_engine_request_uploads.t index bc43716..d0eeb7d 100644 --- a/t/live_engine_request_uploads.t +++ b/t/live_engine_request_uploads.t @@ -155,11 +155,19 @@ use HTTP::Request::Common; [ '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', @@ -169,7 +177,7 @@ use HTTP::Request::Common; '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');