Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix UTF8 bugs on Stardust post. Also finish the POST response

  • Loading branch information...
commit d19956560d38591c4285946b4e487160d012bb3b 1 parent b25f4ce
@miyagawa authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/Tatsumaki/Service/Stardust.pm
View
5 lib/Tatsumaki/Service/Stardust.pm
@@ -2,6 +2,8 @@ package Tatsumaki::Service::Stardust;
use Any::Moose;
extends 'Tatsumaki::Service';
+use Encode ();
+use JSON ();
use Tatsumaki;
use Tatsumaki::MessageQueue;
use Tatsumaki::Application;
@@ -60,12 +62,13 @@ sub post {
my $mq = Tatsumaki::MessageQueue->instance($channel);
- my @events = map JSON::decode_json($_), $self->request->param('m');
+ my @events = map JSON::decode_json(Encode::encode_utf8($_)), $self->request->param('m');
for my $event (@events) {
$mq->publish($event);
}
$self->response->code(204);
+ $self->finish;
}
package Tatsumaki::Service::Stardust::StreamHandler;
Please sign in to comment.
Something went wrong with that request. Please try again.