aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--index.php3
-rw-r--r--src/process-request.php (renamed from trap-post-payload.php)2
2 files changed, 4 insertions, 1 deletions
diff --git a/index.php b/index.php
index efed2bf..cbe3802 100644
--- a/index.php
+++ b/index.php
@@ -1,4 +1,7 @@
+<?php
// SPDX-FileCopyrightText: 2024 Eilertsens Kodeknekkeri
// SPDX-FileCopyrightText: 2024 Harald Eilertsen
//
// SPDX-License-Identifier: AGPL-3.0-or-later
+
+require __DIR__ . '/src/process-request.php';
diff --git a/trap-post-payload.php b/src/process-request.php
index 4316ff1..0df43d9 100644
--- a/trap-post-payload.php
+++ b/src/process-request.php
@@ -19,7 +19,7 @@ $data = [
'BODY' => file_get_contents('php://input'),
];
-$file_name = __DIR__ . "/payloads/{$data['REQUEST_TIME']}-{$data['SERVER_NAME']}.json";
+$file_name = dirname(__DIR__) . "/payloads/{$data['REQUEST_TIME']}-{$data['SERVER_NAME']}.json";
error_log("Trapped request, saving to {$file_name}");
file_put_contents($file_name, json_encode($data));
header("HTTP/1.1 404 Not Found");