aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2024-07-04 13:02:59 +0200
committerHarald Eilertsen <haraldei@anduin.net>2024-07-04 13:02:59 +0200
commit27bf644d5809be63e439484a3f8ffee81b9d367b (patch)
tree37a31ded0cc54c8d7a54ebf57ad27cdbe5043311
parent257269474f4c8b5327d2a4a63129b5c329092059 (diff)
downloadvolse-webtrap-27bf644d5809be63e439484a3f8ffee81b9d367b.tar.gz
volse-webtrap-27bf644d5809be63e439484a3f8ffee81b9d367b.tar.bz2
volse-webtrap-27bf644d5809be63e439484a3f8ffee81b9d367b.zip
Rename trap-post-payload.php and call it from index.php.
-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");