Commit c0724f60 authored by Côme Chilliet's avatar Côme Chilliet

feat(core) Allow Content-Type header with no charset

Used by webservice for application/json

issue #5989
parent e30c2775
......@@ -230,8 +230,10 @@ class Language
if (!headers_sent()) {
header("Content-Language: $lang".(empty($country) ? '' : "-$country"));
if (!empty($char)) {
if (!empty($char) && preg_match('|^text/|', $mime)) {
header("Content-Type: $mime; charset=$char");
} else {
header("Content-Type: $mime");
}
} else {
trigger_error('Could not set language '.$lang.' header, headers already sent');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment