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}})
|
? encode_json({error => $resp_body->{$code}})
|
||||||
: $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';
|
$body = '' if !defined $body || $cgi->request_method() eq 'HEAD';
|
||||||
my $length_header = '';
|
my $length_header = '';
|
||||||
if ($length > 0) {
|
if ($length > 0) {
|
||||||
|
@ -252,6 +256,7 @@ my $enable_experimental_features = $ENV{'ENABLE_EXPERIMENTAL_FEATURES' } || 0;
|
||||||
my $val = $headers->{$header};
|
my $val = $headers->{$header};
|
||||||
$extra_headers .= "\n$header: $val";
|
$extra_headers .= "\n$header: $val";
|
||||||
}
|
}
|
||||||
|
binmode STDOUT, ':utf8';
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
HTTP/1.1 $code $code_description
|
HTTP/1.1 $code $code_description
|
||||||
Server: DotplanApi
|
Server: DotplanApi
|
||||||
|
|
Reference in New Issue