Skip to content

Commit

Permalink
allow WebSocket handshakes to fail more gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 26, 2014
1 parent baf1429 commit 18fb677
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Changes
@@ -1,6 +1,6 @@

5.66 2014-11-25
- Improved send_ok method in Test::Mojo to be able to fail gracefully.
5.66 2014-11-26
- Improved many WebSocket tests in Test::Mojo to be able to fail gracefully.
- Fixed bug in Mojo::DOM::CSS where the :empty pseudo class would not ignore
comments and processing instructions.

Expand Down
1 change: 0 additions & 1 deletion lib/Mojolicious.pm
Expand Up @@ -114,7 +114,6 @@ sub dispatch {
my $res = $tx->res;
return if $res->code;
if (my $code = ($tx->req->error // {})->{advice}) { $res->code($code) }
elsif ($tx->is_websocket) { $res->code(426) }
$c->render_not_found unless $self->routes->dispatch($c) || $tx->res->code;
}

Expand Down
2 changes: 1 addition & 1 deletion t/mojo/websocket.t
Expand Up @@ -173,7 +173,7 @@ $ua->websocket(
);
Mojo::IOLoop->start;
ok !$ws, 'not a WebSocket';
is $code, 426, 'right status';
is $code, 200, 'right status';
ok $body =~ /^(\d+)failed!$/, 'right content';
is $1, 15, 'right timeout';

Expand Down

0 comments on commit 18fb677

Please sign in to comment.