TT#86652 Fix utf8 fax body encoding

* decode utf8 on multipart/form-data request
	   since we encode the json for this content
	   type, and the fax body gets double encoded
	   and ends up wrong

Change-Id: I50d10879e5fe1ba99141e76d311641fcd5d568a1
mr10.2
Flaviu Mates 4 years ago committed by Victor Tsvetov
parent 6a0b5d7a75
commit fe09f80224

@ -7,6 +7,7 @@ use parent qw/NGCP::Panel::Role::Entities NGCP::Panel::Role::API::Faxes/;
use HTTP::Headers qw();
use HTTP::Status qw(:constants);
use Encode qw/decode_utf8/;
use NGCP::Panel::Utils::DateTime;
use NGCP::Panel::Utils::API::Subscribers;
@ -119,7 +120,7 @@ sub create_item {
subscriber => $billing_subscriber,
destination => $form->values->{destination},
upload => $form->values->{faxfile},
data => $form->values->{data},
data => $c->req->headers->content_type eq 'multipart/form-data' ? decode_utf8($form->values->{data}) : $form->values->{data}
);
$c->log->debug("faxserver output:\n");
$c->log->debug($output);

Loading…
Cancel
Save