api: remove unneeded stuff, add special header for android httpurlconnection which seems to be retarded
This commit is contained in:
parent
964f153371
commit
839b065860
|
@ -23,15 +23,12 @@
|
||||||
function_exists("ob_gzhandler")) {
|
function_exists("ob_gzhandler")) {
|
||||||
|
|
||||||
ob_start("ob_gzhandler");
|
ob_start("ob_gzhandler");
|
||||||
|
} else {
|
||||||
|
ob_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
|
||||||
|
|
||||||
$session_expire = SESSION_EXPIRE_TIME; //seconds
|
|
||||||
$session_name = (!defined('TTRSS_SESSION_NAME')) ? "ttrss_sid_api" : TTRSS_SESSION_NAME . "_api";
|
|
||||||
|
|
||||||
session_name($session_name);
|
|
||||||
|
|
||||||
$input = file_get_contents("php://input");
|
$input = file_get_contents("php://input");
|
||||||
|
|
||||||
if (defined('_API_DEBUG_HTTP_ENABLED') && _API_DEBUG_HTTP_ENABLED) {
|
if (defined('_API_DEBUG_HTTP_ENABLED') && _API_DEBUG_HTTP_ENABLED) {
|
||||||
|
@ -70,4 +67,7 @@
|
||||||
|
|
||||||
db_close($link);
|
db_close($link);
|
||||||
|
|
||||||
|
header("Api-Content-Length: " . ob_get_length());
|
||||||
|
|
||||||
|
ob_end_flush();
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -11,6 +11,7 @@ class API extends Handler {
|
||||||
|
|
||||||
function before($method) {
|
function before($method) {
|
||||||
if (parent::before($method)) {
|
if (parent::before($method)) {
|
||||||
|
header("Content-Type: text/plain");
|
||||||
|
|
||||||
if (!$_SESSION["uid"] && $method != "login" && $method != "isloggedin") {
|
if (!$_SESSION["uid"] && $method != "login" && $method != "isloggedin") {
|
||||||
print $this->wrap(self::STATUS_ERR, array("error" => 'NOT_LOGGED_IN'));
|
print $this->wrap(self::STATUS_ERR, array("error" => 'NOT_LOGGED_IN'));
|
||||||
|
@ -24,7 +25,6 @@ class API extends Handler {
|
||||||
|
|
||||||
$this->seq = (int) $_REQUEST['seq'];
|
$this->seq = (int) $_REQUEST['seq'];
|
||||||
|
|
||||||
header("Content-Type: text/plain");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue