X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flive_engine_request_uri.t;h=a957b7ef6bf75abb191943523d33872aa4b845be;hp=b5fc2405834fda2ef6551eb2e658ce9a330e7797;hb=de19de2e6f40d9f8986df5e4f37dc8084a7c83ee;hpb=8af92bd80996775f80e5804483cc44b136aa1933 diff --git a/t/live_engine_request_uri.t b/t/live_engine_request_uri.t index b5fc240..a957b7e 100644 --- a/t/live_engine_request_uri.t +++ b/t/live_engine_request_uri.t @@ -6,7 +6,7 @@ use warnings; use FindBin; use lib "$FindBin::Bin/lib"; -use Test::More tests => 44; +use Test::More tests => 49; use Catalyst::Test 'TestApp'; use Catalyst::Request; @@ -37,6 +37,21 @@ my $creq; is( $creq->base . $creq->path, $creq->uri, 'Base + Path ok' ); } +# test base is correct for HTTPS URLs +SKIP: +{ + if ( $ENV{CATALYST_SERVER} ) { + skip 'Using remote server', 5; + } + + local $ENV{HTTPS} = 'on'; + ok( my $response = request('https://localhost/engine/request/uri'), 'HTTPS Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + ok( eval '$creq = ' . $response->content, 'Unserialize Catalyst::Request' ); + is( $creq->base, 'https://localhost/', 'HTTPS base ok' ); + is( $creq->uri, 'https://localhost/engine/request/uri', 'HTTPS uri ok' ); +} + # test that we can use semi-colons as separators { my $parameters = { @@ -88,7 +103,7 @@ my $creq; { ok( my $response = request('http://localhost/engine/request/uri/uri_with_object'), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); - like( $response->header( 'X-Catalyst-Param-a' ), qr(http://localhost[^/]*/), 'param "a" ok' ); + like( $response->header( 'X-Catalyst-Param-a' ), qr(https?://localhost[^/]*/), 'param "a" ok' ); } # test that uri_with is utf8 safe