issue with some headers

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/134/head
Maxence Lange 2018-12-04 22:50:36 -01:00 zatwierdzone przez Julius Härtl
rodzic 89848f8510
commit 2a47f895ad
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4C614C6ED2CDE6DF
1 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -323,6 +323,16 @@ class ActivityPubController extends Controller {
// uncomment this line to display the result that would be return to an ActivityPub service (TEST)
// return true;
// TODO - cleaner to being able to parse:
// - 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
// - 'application/activity+json, application/ld+json'
$accept = explode(',', $this->request->getHeader('Accept'));
$accept = array_map('trim', $accept);
if (in_array('application/ld+json', $accept)) {
return true;
}
if ($this->request->getHeader('Accept')
=== 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"') {
return true;