merge-requests/5/head
Terence Eden 2024-02-16 09:34:09 +00:00
rodzic 51c71edf1e
commit 7269503af6
1 zmienionych plików z 5 dodań i 6 usunięć

Wyświetl plik

@ -73,8 +73,6 @@
// This runs the function of the path requested.
!empty( $_GET["path"] ) ? $path = $_GET["path"] : die();
switch ($path) {
case "":
die();
case ".well-known/webfinger":
webfinger();
case rawurldecode( $username ):
@ -256,7 +254,7 @@
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "POST" );
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode($message) );
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );
$response = curl_exec( $ch );
curl_exec( $ch );
// Check for errors
if( curl_errno( $ch ) ) {
@ -392,6 +390,7 @@ HTML;
];
// Construct the Message
// The audience is public and it is sent to all followers
$message = [
"@context" => "https://www.w3.org/ns/activitystreams",
"id" => "https://{$server}/posts/{$guid}.json",
@ -427,6 +426,7 @@ HTML;
// Each server needs its own cURL handle
// Each POST to an inbox needs to be signed separately
foreach ( $hosts as $host ) {
// TODO: Not every host uses /inbox
$path = "/inbox";
// Get the signed headers
@ -437,7 +437,6 @@ HTML;
// POST the message and header to the requester's inbox
$ch = curl_init( $remoteServerUrl );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "POST" );
curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode($message) );