getHeaders(); $endpoint = null; if (isset($headers["link"])) { $link = $headers["link"][0]; if (preg_match('/rel=("?)webmention("?)/', $link)) { $matches = []; preg_match('/\<(..*?)\>/', $link, $matches); if (count($matches) > 1) { $endpoint = $matches[1]; } } } if ($endpoint && !str_contains($endpoint, "https://")) { $res = parse_url($response->getInfo('url')); $endpoint = $res["scheme"] . "://" . $res["host"] . $endpoint; } return $endpoint; } }