Merge branch 'status-204' into 'master'

Accept 204 for PuSH subscription

Some hubs (notably, pushpress, used by wordpress.com) return 204 to mean success.

This used to be allowed by the spec, so no harm in accepting it.

See merge request !48
This commit is contained in:
mmn 2015-11-05 15:03:42 +00:00
commit 45b24286e5

View File

@ -355,7 +355,7 @@ class FeedSub extends Managed_DataObject
$response = $client->post($hub, $headers, $post);
$status = $response->getStatus();
// PuSH specificed response status code
if ($status == 202) {
if ($status == 202 || $status == 204) {
common_log(LOG_INFO, __METHOD__ . ': sub req ok, awaiting verification callback');
return;
} else if ($status >= 200 && $status < 300) {