Last active
October 22, 2015 16:10
-
-
Save nicomen/dd12511cf4ac012fb733 to your computer and use it in GitHub Desktop.
Test for handling non-leading slash in specific NGiNX environment
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
use Test::Mojo; | |
use Test::More; | |
my $t = Test::Mojo->new('MyApp'); | |
# FOO-3707: wrong redirect | |
my $url = $t->ua->server->url; | |
my $tx = $t->ua->build_tx('GET' => $url); | |
$tx->req->url->path("path_that_redirects"); # Location: $self->req->url->path =~ s{/$}{}; | |
$tx->req->{start_buffer} = "GET path_that_redirects/ HTTP/1.1\r\n"; | |
$tx = $t->ua->start($tx); | |
is $tx->res->headers->location, '/path_that_redirects', 'Redirect address has a leading slash and no trailing slash'; | |
done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment