]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Accept 204 for PuSH subscription
authorStephen Paul Weber <singpolyma@singpolyma.net>
Tue, 27 Oct 2015 03:16:39 +0000 (03:16 +0000)
committerStephen Paul Weber <singpolyma@singpolyma.net>
Tue, 27 Oct 2015 03:16:39 +0000 (03:16 +0000)
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

index d0ac83b56d754d96946c3c6bdd18c86e553c76ed..6585e9ffb71f60f5c7a5fdd889f982b0f0ed716f 100644 (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) {