This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
16e20b6fc14e06658427b8257c05537033240f56
[perl5.git] / cpan / CGI / t / url.t
1 use strict;
2 use warnings;
3
4 use Test::More tests => 4;    # last test to print
5
6 use CGI qw/ :all /;
7
8 $ENV{HTTP_X_FORWARDED_HOST} = 'proxy:8484';
9 $ENV{SERVER_PROTOCOL}       = 'HTTP/1.0';
10 $ENV{SERVER_PORT}           = 8080;
11 $ENV{SERVER_NAME}           = 'the.good.ship.lollypop.com';
12
13 is virtual_port() => 8484, 'virtual_port()';
14 is server_port()  => 8080, 'server_port()';
15
16 is url() => 'http://proxy:8484', 'url()';
17
18 # let's see if we do the defaults right
19
20 $ENV{HTTP_X_FORWARDED_HOST} = 'proxy:80';
21
22 is url() => 'http://proxy', 'url() with default port';
23