Skip to content

Commit

Permalink
Work around possible HTTP::Tiny issue timing out for receiving empty …
Browse files Browse the repository at this point in the history
…bytes from the servers.

Don't attempt to print empty bytes ('') in the test suite. It used to
work fine with LWP::UserAgent as a client, but causes timeout with
HTTP::Tiny clients for local sockets.

chansen/p5-http-tiny#21
stash/Feersum#14
  • Loading branch information
miyagawa committed Jun 15, 2013
1 parent 7e998a1 commit 8fa4354
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Plack/Test/Suite.pm
Expand Up @@ -28,11 +28,11 @@ our @TEST = (
sub {
my $cb = shift;
my $res = $cb->(GET "http://127.0.0.1/");
is $res->content, $ENV{PLACK_TEST_SCRIPT_NAME};
is $res->content, "script_name=$ENV{PLACK_TEST_SCRIPT_NAME}";
},
sub {
my $env = shift;
return [ 200, ["Content-Type", "text/plain"], [ $env->{SCRIPT_NAME} ] ];
return [ 200, ["Content-Type", "text/plain"], [ "script_name=$env->{SCRIPT_NAME}" ] ];
},
],
[
Expand Down Expand Up @@ -697,7 +697,7 @@ our @TEST = (
);
my $res = $cb->($req);
is $res->header('X-AUTHORIZATION'), 0;
is $res->content, '';
is $res->content, 'no_auth';
};
};
},
Expand All @@ -706,7 +706,7 @@ our @TEST = (
return [
200,
[ 'Content-Type' => 'text/plain', 'X-AUTHORIZATION' => exists($env->{HTTP_AUTHORIZATION}) ? 1 : 0 ],
[ $env->{HTTP_AUTHORIZATION} || '' ],
[ $env->{HTTP_AUTHORIZATION} || 'no_auth' ],
];
},
],
Expand Down

0 comments on commit 8fa4354

Please sign in to comment.