diff options
| author | 2016-08-29 19:52:52 +0200 | |
|---|---|---|
| committer | 2016-08-29 19:52:52 +0200 | |
| commit | 17c8c039df675b3b0f8d88d14f7316a240eabe76 (patch) | |
| tree | 3dd3da3e8f21b5e82905f756098b86e0d15b3935 /p/api | |
| parent | 92d4ad32c9eb165dee6dc6d4b8cf510428dde9ec (diff) | |
| parent | aea7cd78367ef867cdac7082ac1e9f61c4de7e19 (diff) | |
Merge pull request #1233 from FreshRSS/dev1.5.0
Release 1.5.0
Diffstat (limited to 'p/api')
| -rw-r--r-- | p/api/index.php (renamed from p/api/index.html) | 11 | ||||
| -rw-r--r-- | p/api/pshb.php | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/p/api/index.html b/p/api/index.php index 8da0bcb58..3ab4e02b3 100644 --- a/p/api/index.html +++ b/p/api/index.php @@ -11,8 +11,17 @@ <h1>FreshRSS API</h1> <h2>Google Reader compatible API</h2> +<dl> +<dt>Your API address:</dt> +<dd><?php +require('../../constants.php'); +require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader +Minz_Configuration::register('system', DATA_PATH . '/config.php', DATA_PATH . '/config.default.php'); +echo Minz_Url::display('/api/greader.php', 'html', true); +?></dd> +</dl> <ul> -<li><a href="greader.php/check%2Fcompatibility" rel="nofollow">Check full server configuration (with <code>%2F</code> support)</a></li> +<li><a href="greader.php/check%2Fcompatibility" rel="nofollow">Check full server configuration</a></li> <li><a href="greader.php/check/compatibility" rel="nofollow">Check partial server configuration (without <code>%2F</code> support)</a></li> </ul> diff --git a/p/api/pshb.php b/p/api/pshb.php index 7de4cc1a2..650767114 100644 --- a/p/api/pshb.php +++ b/p/api/pshb.php @@ -5,6 +5,7 @@ require(LIB_PATH . '/lib_rss.php'); //Includes class autoloader define('MAX_PAYLOAD', 3145728); header('Content-Type: text/plain; charset=UTF-8'); +header('X-Content-Type-Options: nosniff'); function logMe($text) { file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND); @@ -65,11 +66,13 @@ if (!empty($_REQUEST['hub_mode']) && $_REQUEST['hub_mode'] === 'subscribe') { $hubJson['error'] = true; //Do not assume that PubSubHubbub works until the first successul push } file_put_contents('./!hub.json', json_encode($hubJson)); + header('Connection: close'); exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : ''); } if (!empty($_REQUEST['hub_mode']) && $_REQUEST['hub_mode'] === 'unsubscribe') { if (empty($hubJson['lease_end']) || $hubJson['lease_end'] < time()) { + header('Connection: close'); exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : ''); } else { header('HTTP/1.1 422 Unprocessable Entity'); |
