fixed utf-8 output
This commit is contained in:
parent
a56ba058e4
commit
4338d05cf6
|
@ -239,7 +239,11 @@ my $enable_experimental_features = $ENV{'ENABLE_EXPERIMENTAL_FEATURES' } || 0;
|
|||
? encode_json({error => $resp_body->{$code}})
|
||||
: $resp_body->{$code};
|
||||
}
|
||||
my $length = defined $body ? length($body) : 0;
|
||||
my $length;
|
||||
{
|
||||
use bytes;
|
||||
$length = defined $body ? length($body) : 0;
|
||||
};
|
||||
$body = '' if !defined $body || $cgi->request_method() eq 'HEAD';
|
||||
my $length_header = '';
|
||||
if ($length > 0) {
|
||||
|
@ -252,6 +256,7 @@ my $enable_experimental_features = $ENV{'ENABLE_EXPERIMENTAL_FEATURES' } || 0;
|
|||
my $val = $headers->{$header};
|
||||
$extra_headers .= "\n$header: $val";
|
||||
}
|
||||
binmode STDOUT, ':utf8';
|
||||
print <<EOF;
|
||||
HTTP/1.1 $code $code_description
|
||||
Server: DotplanApi
|
||||
|
|
Reference in New Issue