diff --git a/controllers/API.php b/controllers/API.php index 5292d05..fd4258a 100644 --- a/controllers/API.php +++ b/controllers/API.php @@ -301,6 +301,9 @@ class API { if($status && $status->http_code) $data['http_code'] = (int)$status->http_code; + if($status && $status->raw_response) + $data['http_body'] = $status->raw_response; + if($summary) $data['summary'] = $summary; diff --git a/lib/Telegraph/Webmention.php b/lib/Telegraph/Webmention.php index b97ba36..0d60f39 100644 --- a/lib/Telegraph/Webmention.php +++ b/lib/Telegraph/Webmention.php @@ -45,15 +45,21 @@ class Webmention { $payload = [ 'source' => $webmention->source, 'target' => $webmention->target, - 'status' => $code + 'status' => $code, ]; if($webmention->webmention_endpoint) { $payload['type'] = 'webmention'; - } - if($webmention->pingback_endpoint) { + } elseif($webmention->pingback_endpoint) { $payload['type'] = 'pingback'; } + if($status->http_code) { + $payload['http_code'] = $status->http_code; + } + if($raw) { + $payload['http_body'] = $raw; + } + return self::$http->post($webmention->callback, $payload); } }