Update FederationController

pull/917/head
Daniel Supernault 2019-03-01 16:19:03 -07:00
rodzic da28b13545
commit bca53ae40e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -242,9 +242,16 @@ XML;
protected function blindKeyRotation(Request $request, Profile $profile)
{
$signature = $request->header('signature');
$date = $request->header('date');
if(!$signature) {
abort(400, 'Missing signature header');
}
if(!$date) {
abort(400, 'Missing date header');
}
if(!now()->parse($date)->gt(now()->subDays(1)) || !now()->parse($date)->lt(now()->addDays(1))) {
abort(400, 'Invalid date');
}
$signatureData = HttpSignature::parseSignatureHeader($signature);
$keyId = Helpers::validateUrl($signatureData['keyId']);
$actor = Profile::whereKeyId($keyId)->whereNotNull('remote_url')->firstOrFail();