diff options
| author | 2016-07-30 23:37:13 +0200 | |
|---|---|---|
| committer | 2016-07-30 23:37:13 +0200 | |
| commit | 462c1e208f02e4977c7e96c0f5936987931d5bc1 (patch) | |
| tree | 24039e05463f9d84dae785fa873b797ed8f35b31 /p/api/pshb.php | |
| parent | a78b3f5e7f19a1f1320fcb12f7c8b450f9a9dba4 (diff) | |
PSHB: work-around for SuperFeeder
Feeds using SuperFeeder for PubSubHubbub push had timeout problems
during substription.
SuperFeeder bot was returning 422 "We could not verify your callback
Error: ETIMEDOUT"
It seems to be due to the the fact that SuperFeeder bot uses keep-alive
but expects the server to close the connection.
https://github.com/FreshRSS/FreshRSS/issues/312#issuecomment-73716936
Diffstat (limited to 'p/api/pshb.php')
| -rw-r--r-- | p/api/pshb.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/p/api/pshb.php b/p/api/pshb.php index 7de4cc1a2..136b98fc9 100644 --- a/p/api/pshb.php +++ b/p/api/pshb.php @@ -65,11 +65,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'); |
