PageRenderTime 21ms CodeModel.GetById 11ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/t/010_core/request-hostname.t

http://github.com/http-engine/HTTP-Engine
Unknown | 19 lines | 14 code | 5 blank | 0 comment | 0 complexity | 6475584b3ac9e99e1f43030cb089b319 MD5 | raw file
 1use strict;
 2use warnings;
 3use Test::More;
 4use HTTP::Engine::Request;
 5use t::Utils;
 6
 7plan tests => 2;
 8
 9# get hostname by REMOTE_HOST
10$ENV{REMOTE_HOST} = "mudage.example.com";
11is _get(), "mudage.example.com";
12
13# get hostname by REMOTE_ADDR
14$ENV{REMOTE_HOST} = '';
15$ENV{REMOTE_ADDR} = "127.0.0.1";
16ok _get();
17
18sub _get { req()->hostname }
19