mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-23 05:34:55 +00:00
parent
78faf88563
commit
0773e21034
1 changed files with 7 additions and 2 deletions
|
@ -23,13 +23,18 @@ class Response {
|
||||||
|
|
||||||
function output() {
|
function output() {
|
||||||
if(!headers_sent()) {
|
if(!headers_sent()) {
|
||||||
header("Status: ".$this->code." ".Arsse::$lang->msg("HTTP.Status.".$this->code));
|
try {
|
||||||
|
$statusText = Arsse::$lang->msg("HTTP.Status.".$this->code);
|
||||||
|
} catch(\JKingWeb\Arsse\Lang\Exception $e) {
|
||||||
|
$statusText = "";
|
||||||
|
}
|
||||||
|
header("Status: ".$this->code." ".$statusText);
|
||||||
$body = "";
|
$body = "";
|
||||||
if(!is_null($this->payload)) {
|
if(!is_null($this->payload)) {
|
||||||
header("Content-Type: ".$this->type);
|
header("Content-Type: ".$this->type);
|
||||||
switch($this->type) {
|
switch($this->type) {
|
||||||
case self::T_JSON:
|
case self::T_JSON:
|
||||||
$body = json_encode($this->payload,\JSON_PRETTY_PRINT);
|
$body = (string) json_encode($this->payload,\JSON_PRETTY_PRINT);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$body = (string) $this->payload;
|
$body = (string) $this->payload;
|
||||||
|
|
Loading…
Reference in a new issue