Quellcode durchsuchen

Merge pull request #1184 from Alkarex/SuperFeeder_timeout

PSHB: work-around for SuperFeeder
Alexandre Alapetite vor 9 Jahren
Ursprung
Commit
722c0cb8b2
2 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  1. 1 0
      CHANGELOG.md
  2. 2 0
      p/api/pshb.php

+ 1 - 0
CHANGELOG.md

@@ -25,6 +25,7 @@
 * API
 * API
 	* Add API link in FreshRSS profile settings to ease set-up [#1186](https://github.com/FreshRSS/FreshRSS/pull/1186)
 	* Add API link in FreshRSS profile settings to ease set-up [#1186](https://github.com/FreshRSS/FreshRSS/pull/1186)
 * Mics.
 * Mics.
+	* Work-around for SuperFeeder time-outs during PubSubHubbub registration [#1184](https://github.com/FreshRSS/FreshRSS/pull/1184)
 	* JSHint of JavaScript code and better initialisation [#1196](https://github.com/FreshRSS/FreshRSS/pull/1196)
 	* JSHint of JavaScript code and better initialisation [#1196](https://github.com/FreshRSS/FreshRSS/pull/1196)
 	* Updated credits, and images in README [#1201](https://github.com/FreshRSS/FreshRSS/issues/1201)
 	* Updated credits, and images in README [#1201](https://github.com/FreshRSS/FreshRSS/issues/1201)
 
 

+ 2 - 0
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
 		$hubJson['error'] = true;	//Do not assume that PubSubHubbub works until the first successul push
 	}
 	}
 	file_put_contents('./!hub.json', json_encode($hubJson));
 	file_put_contents('./!hub.json', json_encode($hubJson));
+	header('Connection: close');
 	exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : '');
 	exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : '');
 }
 }
 
 
 if (!empty($_REQUEST['hub_mode']) && $_REQUEST['hub_mode'] === 'unsubscribe') {
 if (!empty($_REQUEST['hub_mode']) && $_REQUEST['hub_mode'] === 'unsubscribe') {
 	if (empty($hubJson['lease_end']) || $hubJson['lease_end'] < time()) {
 	if (empty($hubJson['lease_end']) || $hubJson['lease_end'] < time()) {
+		header('Connection: close');
 		exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : '');
 		exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : '');
 	} else {
 	} else {
 		header('HTTP/1.1 422 Unprocessable Entity');
 		header('HTTP/1.1 422 Unprocessable Entity');