Created
June 6, 2017 09:41
-
-
Save aereal/52cc757bea2cf2be1a1514751a6d3251 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use HTTP::Message::PSGI qw(req_to_psgi); | |
use HTTP::Request; | |
use Plack::Request; | |
use Test::More; | |
use URI; | |
my $req = HTTP::Request->new( | |
'GET', | |
URI->new('http://example.com/'), | |
[ | |
'Host' => 'another.example.com', | |
], | |
); | |
is $req->uri->host, 'example.com'; | |
my $psgi_req = Plack::Request->new(req_to_psgi($req)); | |
is $psgi_req->uri->host, 'example.com'; # !!! | |
done_testing; |
Author
aereal
commented
Jun 6, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment