Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix styles and bugs in the body streaming check #275 #276

  • Loading branch information...
commit d99efef6553ea24e08d2f6174e31a3bed32351b3 1 parent d7b54a6
Tatsuhiko Miyagawa miyagawa authored
16 lib/Plack/Middleware/ConditionalGET.pm
View
@@ -18,17 +18,11 @@ sub call {
$res->[0] = 304;
$h->remove($_) for qw( Content-Type Content-Length Content-Disposition );
if ($res->[2]) {
- $res->[2] = [];
- }
- else {
- my $done;
- return sub {
- unless ($done) {
- return q{};
- }
- $done = 1;
- return defined $_[0] ? q{} : undef;
- };
+ $res->[2] = [];
+ } else {
+ return sub {
+ return defined $_[0] ? '' : undef;
+ };
}
}
});
18 lib/Plack/Middleware/Head.pm
View
@@ -11,18 +11,12 @@ sub call {
$self->response_cb($self->app->($env), sub {
my $res = shift;
- if ( $res->[2] ) {
- $res->[2] = [];
- }
- else {
- my $done;
- return sub {
- unless ($done) {
- return q{};
- }
- $done = 1;
- return defined $_[0] ? q{} : undef;
- };
+ if ($res->[2]) {
+ $res->[2] = [];
+ } else {
+ return sub {
+ return defined $_[0] ? '': undef;
+ };
}
});
}
Please sign in to comment.
Something went wrong with that request. Please try again.