From 080fd0f374fbe77924c1da3c243c6be3aeb1a56d Mon Sep 17 00:00:00 2001 From: Colin Mollenhour Date: Wed, 31 Jan 2018 12:11:03 -0500 Subject: [PATCH] Support X-Forwarded-Prefix (e.g. Traefik PathPrefixStrip feature) --- adminer/include/bootstrap.inc.php | 3 +++ changes.txt | 1 + 2 files changed, 4 insertions(+) diff --git a/adminer/include/bootstrap.inc.php b/adminer/include/bootstrap.inc.php index a7ba0513..83e8b679 100644 --- a/adminer/include/bootstrap.inc.php +++ b/adminer/include/bootstrap.inc.php @@ -33,6 +33,9 @@ if (!$_SERVER["REQUEST_URI"]) { // IIS 5 compatibility if (!strpos($_SERVER["REQUEST_URI"], '?') && $_SERVER["QUERY_STRING"] != "") { // IIS 7 compatibility $_SERVER["REQUEST_URI"] .= "?$_SERVER[QUERY_STRING]"; } +if ($_SERVER["HTTP_X_FORWARDED_PREFIX"]) { + $_SERVER["REQUEST_URI"] = $_SERVER["HTTP_X_FORWARDED_PREFIX"] . $_SERVER["REQUEST_URI"]; +} $HTTPS = $_SERVER["HTTPS"] && strcasecmp($_SERVER["HTTPS"], "off"); @ini_set("session.use_trans_sid", false); // protect links in export, @ - may be disabled diff --git a/changes.txt b/changes.txt index 1cc6ea06..927f62ec 100644 --- a/changes.txt +++ b/changes.txt @@ -3,6 +3,7 @@ Fix counting selected rows after going back to select page PHP <5.3 compatibility even with Elasticsearch enabled Fully support functions in default values Stop redirecting links via adminer.org +Support X-Forwarded-Prefix MySQL: Display warnings in SQL command MariaDB: Support JSON since MariaDB 10.2 PostgreSQL: Support functions