bug2701.patch
root/usr/libexec/nethserver/smwingsd | ||
---|---|---|
84 | 84 |
} |
85 | 85 | |
86 | 86 |
$self->log(4, "<< $payload"); |
87 |
return (from_json($payload, {utf8 => 1, pretty => 0, allow_nonref => 1}), $msg_type);
|
|
87 |
return (JSON->new->decode($payload), $msg_type);
|
|
88 | 88 |
} |
89 | 89 | |
90 | 90 |
sub write_response { |
91 | 91 |
my $self = shift; |
92 | 92 |
my $msg_type = shift; |
93 | 93 |
my $response = shift; |
94 |
my $payload = to_json($response, {utf8 => 1, pretty => 0, allow_nonref => 1});
|
|
94 |
my $payload = JSON->new->allow_nonref->latin1->encode($response);
|
|
95 | 95 |
$self->log(4, ">> $payload"); |
96 | 96 |
print pack("CN", $msg_type, length($payload)) . $payload; |
97 | 97 |
} |