diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2023-10-23 14:02:49 +0200 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2026-03-03 15:55:26 +0000 |
| commit | 568a8a110d9949af4ccd80c2cee5f33b08cb878c (patch) | |
| tree | b6de1744a577f4d9d439928b259f9975f4341083 | |
| parent | 622ab434b7d9bb9b75bce0e0c61dfea43ede01e6 (diff) | |
Request::path: remove trailing slash from REVERSE_PROXY_TARGET_URLbiest-02386
| -rw-r--r-- | lib/classes/Request.php | 5 |
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; |
