diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-05-12 11:06:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-12 11:06:10 +0200 |
commit | d868df186b049569a2cfe480eeab6f5251738ef6 (patch) | |
tree | 5d8e45a3f13f8d78654f911376116cd39cbb00ba | |
parent | f9d8281224495e6b93b0f6e63042a81e4cb0028f (diff) | |
parent | e577395e4085e8d87c373b621fe0c1a931cffbf4 (diff) |
Merge pull request #1179 from mnd/peertube-interoperability-fix
Allow to follow to PeerTube 3.0.0 users
-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, |