aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2023-10-23 14:02:49 +0200
committerMoritz Strohm <strohm@data-quest.de>2026-03-03 15:55:26 +0000
commit568a8a110d9949af4ccd80c2cee5f33b08cb878c (patch)
treeb6de1744a577f4d9d439928b259f9975f4341083 /lib
parent622ab434b7d9bb9b75bce0e0c61dfea43ede01e6 (diff)
Request::path: remove trailing slash from REVERSE_PROXY_TARGET_URLbiest-02386
Diffstat (limited to 'lib')
-rw-r--r--lib/classes/Request.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/classes/Request.php b/lib/classes/Request.php
index df0884a..3393567 100644
--- a/lib/classes/Request.php
+++ b/lib/classes/Request.php
@@ -144,6 +144,11 @@ class Request implements ArrayAccess, IteratorAggregate
if (!empty($GLOBALS['REVERSE_PROXY_TARGET_URL'])) {
//Only return the remainder of the path that is not part of REVERSE_PROXY_TARGET_URL.
$reverse_proxy_target_path = parse_url($GLOBALS['REVERSE_PROXY_TARGET_URL'], PHP_URL_PATH);
+ if ($reverse_proxy_target_path[-1] === '/') {
+ //Remove the slash at the end since REQUEST_URI will contain one.
+ $reverse_proxy_target_path = mb_substr($reverse_proxy_target_path, 0, -1);
+ }
+
$remaining_path = substr($_SERVER['REQUEST_URI'], strlen($reverse_proxy_target_path));
if ($remaining_path[0] !== '/') {
$remaining_path = '/' . $remaining_path;