Prototype gitea filter
This commit is contained in:
parent
db60346a8c
commit
0daf2494d2
4 changed files with 51 additions and 2 deletions
|
@ -77,7 +77,8 @@ class app
|
|||
private function handleIncomingData(): void
|
||||
{
|
||||
$post = file_get_contents("php://input");
|
||||
$wh = new Webhook($post);
|
||||
$filter = $this->checkIfFilterNeeded();
|
||||
$wh = new Webhook($post,$filter);
|
||||
$xmpp = new Xmpp();
|
||||
|
||||
$xmpp->start();
|
||||
|
@ -86,6 +87,15 @@ class app
|
|||
$xmpp->disconnect();
|
||||
}
|
||||
|
||||
private function checkIfFilterNeeded()
|
||||
{
|
||||
if(in_array("X-Gitea",$_SERVER))
|
||||
{
|
||||
return 'gitea';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function getRealIPAddr()
|
||||
{
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP']))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue