1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 12:14:06 +02:00

Merge branch '3.1.x' into 3.2.x

* 3.1.x:
  [ticket/14481] Add tests for x_forwarded_proto header
  [ticket/14481] Use port 443 if https is specified in x-forwarded-proto
  [ticket/14481] Respect HTTP_X_FORWARDED headers for implying https
This commit is contained in:
Tristan Darricau
2016-03-27 12:56:03 +02:00
5 changed files with 126 additions and 6 deletions

View File

@@ -280,7 +280,13 @@ class oauth extends \phpbb\auth\provider\base
}
$uri_factory = new \OAuth\Common\Http\Uri\UriFactory();
$current_uri = $uri_factory->createFromSuperGlobalArray($this->request->get_super_global(\phpbb\request\request_interface::SERVER));
$super_globals = $this->request->get_super_global(\phpbb\request\request_interface::SERVER);
if (!empty($super_globals['HTTP_X_FORWARDED_PROTO']) && $super_globals['HTTP_X_FORWARDED_PROTO'] === 'https')
{
$super_globals['HTTPS'] = 'on';
$super_globals['SERVER_PORT'] = 443;
}
$current_uri = $uri_factory->createFromSuperGlobalArray($super_globals);
$current_uri->setQuery($query);
$this->current_uri = $current_uri;