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.
This commit is contained in:
Stephen Paul Weber 2015-10-27 03:16:39 +00:00
parent 0ba53edd96
commit 4c2bc465a0

View File

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