<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\Model\APContact;
use Friendica\Model\Contact;
use Friendica\Model\User;
-use Friendica\Network\HTTPClient\Response\CurlResult;
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
-use Friendica\Network\HTTPClient\Capability\ICanHandleHttpResponses;
/**
* Implements HTTP Signatures per draft-cavage-http-signatures-07.
// Decide if $data arrived via controller submission or curl.
$headers = [];
- $headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']).' '.$_SERVER['REQUEST_URI'];
+ $headers['(request-target)'] = strtolower(DI::args()->getMethod()).' '.$_SERVER['REQUEST_URI'];
foreach ($_SERVER as $k => $v) {
if (strpos($k, 'HTTP_') === 0) {
* @return \Friendica\Network\HTTPClient\Capability\ICanHandleHttpResponses CurlResult
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function fetchRaw($request, $uid = 0, $opts = ['accept_content' => ['application/activity+json', 'application/ld+json']])
+ public static function fetchRaw($request, $uid = 0, $opts = ['accept_content' => ['application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"']])
{
$header = [];
public static function getSigner($content, $http_headers)
{
if (empty($http_headers['HTTP_SIGNATURE'])) {
- Logger::info('No HTTP_SIGNATURE header');
+ Logger::debug('No HTTP_SIGNATURE header');
return false;
}
}
$headers = [];
- $headers['(request-target)'] = strtolower($http_headers['REQUEST_METHOD']) . ' ' . parse_url($http_headers['REQUEST_URI'], PHP_URL_PATH);
+ $headers['(request-target)'] = strtolower(DI::args()->getMethod()) . ' ' . parse_url($http_headers['REQUEST_URI'], PHP_URL_PATH);
// First take every header
foreach ($http_headers as $k => $v) {