Fix high number of requests when deleting an account on other fediverse software

parent d6bfcaa3
RewriteEngine On
RewriteRule "^(.*)$" "app.php?q=$1" [L,QSA]
RewriteRule "^(.*)$" "app.php?" [L]
......@@ -15,8 +15,17 @@ if($serverEnv!="dev"){
require("autoload.php");
if(isset($_GET["q"]) && $_GET["q"]!=""){
$q=$_GET["q"];
if(isset($_SERVER["REQUEST_URI"]) && $_SERVER["REQUEST_URI"]!=""){
$q=substr($_SERVER["REQUEST_URI"],1);
if(strpos($q,"?")){
http_response_code(404);
echo("404 error : not found");
exit;
}
//$q=str_replace("?","",$q);
if($q==""){
$q="index";
}
}else{
$q="index";
}
......
......@@ -135,8 +135,8 @@ class Core{
"type" => "Service",
"following" => "https://".$this->subdomain.".activitypub.actor/".$username."/following",
"followers" => "https://".$this->subdomain.".activitypub.actor/".$username."/followers",
"inbox" => "https://".$this->subdomain.".activitypub.actor/".$username."/inbox",
"outbox" => "https://".$this->subdomain.".activitypub.actor/".$username."/outbox",
//"inbox" => "https://".$this->subdomain.".activitypub.actor/".$username."/inbox",
//"outbox" => "https://".$this->subdomain.".activitypub.actor/".$username."/outbox",
"preferredUsername" => "".$username,
"name" => "".$username,
"summary" => "<p>".$description."</p>",
......@@ -162,9 +162,9 @@ class Core{
"mediaType" => "image/jpeg",
"url" => "https://".$this->subdomain.".activitypub.actor/".$username."/header.jpg",
),
"endpoints" => array(
/*"endpoints" => array(
"sharedInbox" => "https://".$this->subdomain.".activitypub.actor/".$username."/inbox",
),
),*/
);
header('Content-type: application/activity+json');
$this->echoWithLog(json_encode($activityjson,JSON_UNESCAPED_SLASHES));
......@@ -208,7 +208,6 @@ class Core{
header("Content-type: image/jpeg;charset=utf-8");
echo($image);
break;
case "inbox":
case "outbox":
case "following":
case "followers":
......@@ -223,6 +222,10 @@ class Core{
header('Content-type: application/activity+json');
$this->echoWithLog(json_encode($activityjson,JSON_UNESCAPED_SLASHES));
break;
case "inbox":
http_response_code(501);
echo("501 error : not implemented");
break;
default:
http_response_code(404);
echo("404 error : not found");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment