From 79edeb10d4e22038f39b70b6dd162998be75b6c5 Mon Sep 17 00:00:00 2001 From: Andy Dawson Date: Mon, 26 Mar 2018 10:16:54 +0000 Subject: [PATCH] Fix x-forwarded-proto detection --- lib/Raven/Client.php | 4 ++-- test/Raven/Tests/ClientTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Raven/Client.php b/lib/Raven/Client.php index 751c5fa59..40a450f0f 100644 --- a/lib/Raven/Client.php +++ b/lib/Raven/Client.php @@ -1322,8 +1322,8 @@ protected function isHttps() } if (!empty($this->trust_x_forwarded_proto) && - !empty($_SERVER['X-FORWARDED-PROTO']) && - $_SERVER['X-FORWARDED-PROTO'] === 'https') { + !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && + $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { return true; } diff --git a/test/Raven/Tests/ClientTest.php b/test/Raven/Tests/ClientTest.php index 528eddabe..022e225b0 100644 --- a/test/Raven/Tests/ClientTest.php +++ b/test/Raven/Tests/ClientTest.php @@ -1650,7 +1650,7 @@ public function currentUrlProvider() array( 'REQUEST_URI' => '/', 'HTTP_HOST' => 'example.com', - 'X-FORWARDED-PROTO' => 'https' + 'HTTP_X_FORWARDED_PROTO' => 'https' ), array(), 'http://example.com/', @@ -1660,7 +1660,7 @@ public function currentUrlProvider() array( 'REQUEST_URI' => '/', 'HTTP_HOST' => 'example.com', - 'X-FORWARDED-PROTO' => 'https' + 'HTTP_X_FORWARDED_PROTO' => 'https' ), array('trust_x_forwarded_proto' => true), 'https://example.com/',