Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/Mojo/WebSocketProxy/Backend.pm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,13 @@ sub make_call_params {
$call_params->{args} = $args;

if (defined $stash_params) {
$call_params->{$_} = $c->stash($_) for @$stash_params;
for my $param (@$stash_params) {
$call_params->{$param} = $c->stash($param);

if (defined $c->stash('rpc_storage') && exists $c->stash('rpc_storage')->{$param}) {
$call_params->{$param} = $c->stash('rpc_storage')->{$param};
}
}
}

return $call_params;
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/WebSocketProxy/Dispatcher.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ use Mojo::WebSocketProxy::Config;

use Class::Method::Modifiers;

use JSON::MaybeUTF8 qw(:v1);
use JSON::MaybeUTF8 qw(:v1);
use Unicode::Normalize ();
use Future::Mojo 0.004; # ->new_timeout
use Future::Utils qw(fmap);
use Scalar::Util qw(blessed);
use Scalar::Util qw(blessed);
use Encode;
use DataDog::DogStatsd::Helper qw(stats_inc);

Expand Down
4 changes: 2 additions & 2 deletions t/05_basic.t
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ $t->websocket_ok('/api' => {});
$t = $t->send_ok({json => {some_action => 1}})->message_ok;
$res = decode_json_utf8($t->message->[1]);

is $url, 'http://rpc-host.com:8080/some_action', 'It should use url + method';
is $call_params->{method}, 'some_action', 'It should use method from actions';
is $url, 'http://rpc-host.com:8080/some_action', 'It should use url + method';
is $call_params->{method}, 'some_action', 'It should use method from actions';
ok $call_params->{id}, 'It should generate call id';
is_deeply $call_params->{params}->{args}, {some_action => 1}, 'It should forward message params';
is_deeply $res,
Expand Down