summaryrefslogtreecommitdiffstats
path: root/t/hostname.t
blob: 7b0e20d9ea3fa9ac530d939296db49d0599a32a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Plack::Test;

use Web::Request;

my $req = Web::Request->new_from_env({ REMOTE_HOST => "foo.example.com" });
is $req->remote_host, "foo.example.com";

$req = Web::Request->new_from_env({ REMOTE_HOST => '', REMOTE_ADDR => '127.0.0.1' });
is $req->address, "127.0.0.1";

done_testing;