Skip to content

Commit

Permalink
improved streaming upload test a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 7, 2011
1 parent e2c8843 commit 8a7a7d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions t/mojolicious/upload_stream_lite_app.t
Expand Up @@ -29,7 +29,7 @@ app->hook(
$req->on_progress(sub { });

# Trigger early request for streaming uploads
$tx->on_request->($tx) if $req->url->path =~ /^\/upload/;
$tx->on_request->($tx) if $req->url->path->parts ~~ ['upload'];
}
);
}
Expand All @@ -42,7 +42,7 @@ post '/upload' => sub {

# First invocation, prepare streaming upload
$self->req->body(sub { $uploads->{shift->url->query->param('id')} .= pop });
return unless $self->tx->req->is_done;
return unless $self->req->is_done;

# Second invocation, render response
$self->render(data => $uploads->{$self->param('id')});
Expand Down

0 comments on commit 8a7a7d6

Please sign in to comment.