From 4c2bc465a0fe841db4942a0116f3b90989df1cf9 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 27 Oct 2015 03:16:39 +0000 Subject: [PATCH] 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. --- plugins/OStatus/classes/FeedSub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/OStatus/classes/FeedSub.php b/plugins/OStatus/classes/FeedSub.php index d0ac83b56d..6585e9ffb7 100644 --- a/plugins/OStatus/classes/FeedSub.php +++ b/plugins/OStatus/classes/FeedSub.php @@ -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) {