-$res = file_get_contents($hub, false, $ctx);
-list($http, $code, $rest) = explode(' ', $http_response_header[0]);
-if (intval($code / 100) === 2) {
- echo "notified hub\n";
- header('Location: /');
- exit();
+ $res = file_get_contents($hub, false, $ctx);
+ list($http, $code, $rest) = explode(' ', $http_response_header[0]);
+ if (intval($code / 100) !== 2) {
+ echo "Error notifying hub: HTTP status was not 2xx; got $code\n";
+ echo $res . "\n";
+ echo 'URL: ' . $url . "\n";
+ } else {
+ //echo "notified hub: $url\n";
+ }