Skip to content

Commit 403f5cc

Browse files
author
Krzysztof Tomasz Zembrowski
committed
Charset in Content-Type header
1 parent 64d7397 commit 403f5cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

application/libraries/REST_Controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,15 +476,15 @@ public function response($data = null, $http_code = null, $continue = false)
476476
// If the format method exists, call and return the output in that format
477477
if (method_exists($this, '_format_'.$this->response->format)) {
478478
// Set the correct format header
479-
header('Content-Type: '.$this->_supported_formats[$this->response->format]);
479+
header('Content-Type: '.$this->_supported_formats[$this->response->format] . '; charset=' . strtolower($this->config->item('charset')));
480480

481481
$output = $this->{'_format_'.$this->response->format}($data);
482482
}
483483

484484
// If the format method exists, call and return the output in that format
485485
elseif (method_exists($this->format, 'to_'.$this->response->format)) {
486486
// Set the correct format header
487-
header('Content-Type: '.$this->_supported_formats[$this->response->format]);
487+
header('Content-Type: '.$this->_supported_formats[$this->response->format] . '; charset=' . strtolower($this->config->item('charset')));
488488

489489
$output = $this->format->factory($data)->{'to_'.$this->response->format}();
490490
}

0 commit comments

Comments
 (0)