diff options
-rw-r--r-- | lib/Service/ConfigService.php | 2 | ||||
-rw-r--r-- | lib/Service/CurlService.php | 3 | ||||
-rw-r--r-- | lib/Service/SignatureService.php | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index 20e20412..2d36345f 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -420,7 +420,7 @@ class ConfigService { if ($request->getType() === Request::TYPE_GET) { $request->addHeader( - 'Accept', 'application/json; profile="https://www.w3.org/ns/activitystreams"' + 'Accept', 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' ); } diff --git a/lib/Service/CurlService.php b/lib/Service/CurlService.php index 7f572a83..c9005149 100644 --- a/lib/Service/CurlService.php +++ b/lib/Service/CurlService.php @@ -167,6 +167,9 @@ class CurlService { } $url = $this->get('Link.@attributes.template', $result, ''); + if ($url === '') { + throw new HostMetaException('Failed to get URL'); + } $host = parse_url($url, PHP_URL_HOST); $protocols = [parse_url($url, PHP_URL_SCHEME)]; diff --git a/lib/Service/SignatureService.php b/lib/Service/SignatureService.php index 5c1b4e86..eaddfa3f 100644 --- a/lib/Service/SignatureService.php +++ b/lib/Service/SignatureService.php @@ -131,7 +131,7 @@ class SignatureService { $localActor = $this->actorsRequest->getFromId($queue->getAuthor()); - $headersElements = ['content-length', 'date', 'host', 'digest']; + $headersElements = ['(request-target)', 'content-length', 'date', 'host', 'digest']; $allElements = [ '(request-target)' => 'post ' . $path->getPath(), 'date' => $date, |