5 use HTTP::Request::Common;
6 use Test::More tests => 9;
14 # a live test against TestApp, the test application
15 use Catalyst::Test 'TestApp';
20 my ($res, $c) = ctx_request(GET('http://localhost/',
21 'X-Request-Base' => $base ));
25 is(req_with_base('http://localhost/')->res->body, 'http://localhost/');
26 is(req_with_base('https://localhost/')->res->body, 'https://localhost/');
27 ok req_with_base('https://localhost/')->req->secure;
29 is(req_with_base('https://example.com:445/')->res->body,
30 'https://example.com:445/');
31 is(req_with_base('http://example.com:443/')->res->body,
32 'http://example.com:443/');
33 is(req_with_base('https://example.com:445/some/path')->res->body,
34 'https://example.com:445/some/path/');
35 is(req_with_base('https://example.com:445/some/path/')->res->body,
36 'https://example.com:445/some/path/');
38 ok req_with_base('https://example.com:80/')->req->secure;
39 ok !req_with_base('http://example.com:443/')->req->secure;