diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-09-27 11:09:11 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-09-27 11:09:11 -0500 |
commit | 9cacfa256a9f9c3798b0d8b67e413217a32ec90c (patch) | |
tree | 1cb1e34bc3d5e3cc646daa756c78d9215cf32d85 /t | |
parent | 217ffe760a9cded965c8dcf10bec2c44fdbfdca9 (diff) | |
download | web-request-9cacfa256a9f9c3798b0d8b67e413217a32ec90c.tar.gz web-request-9cacfa256a9f9c3798b0d8b67e413217a32ec90c.zip |
add 'host' method
Diffstat (limited to 't')
-rw-r--r-- | t/base.t | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -26,11 +26,13 @@ my @tests = ( { scheme => 'http', server_name => 'example.com', server_port => 80, - base => 'http://example.com/' }, + base => 'http://example.com/', + expected_host => 'example.com:80' }, { scheme => 'http', server_name => 'example.com', server_port => 8080, - base => 'http://example.com:8080/' }, + base => 'http://example.com:8080/', + expected_host => 'example.com:8080' }, { host => 'foobar.com', server_name => 'example.com', server_port => 8080, @@ -48,6 +50,8 @@ for my $block (@tests) { my $req = Web::Request->new_from_env($env); is $req->base_uri, $block->{base}; + my $expected_host = $block->{expected_host} || $block->{host}; + is $req->host, $expected_host; } done_testing; |