Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The position of setting trusted proxies is too late #3698

Merged
merged 1 commit into from Apr 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 16 additions & 17 deletions web/concrete/bootstrap/start.php
Expand Up @@ -134,6 +134,22 @@
// Register all other providers
$list->registerProviders($config->get('app.providers'));

/**
* ----------------------------------------------------------------------------
* Set trusted proxies and headers for the request
* ----------------------------------------------------------------------------
*/

if($proxyHeaders = $config->get('concrete.security.trusted_proxies.headers')){
foreach($proxyHeaders as $key => $value) {
Request::setTrustedHeaderName($key, $value);
}
}

if($trustedProxiesIps = $config->get('concrete.security.trusted_proxies.ips')) {
Request::setTrustedProxies($trustedProxiesIps);
}

/**
* ----------------------------------------------------------------------------
* Legacy Definitions
Expand Down Expand Up @@ -190,23 +206,6 @@
*/
include DIR_APPLICATION . '/bootstrap/app.php';


/**
* ----------------------------------------------------------------------------
* Set trusted proxies and headers for the request
* ----------------------------------------------------------------------------
*/

if($proxyHeaders = $config->get('concrete.security.trusted_proxies.headers')){
foreach($proxyHeaders as $key => $value) {
Request::setTrustedHeaderName($key, $value);
}
}

if($trustedProxiesIps = $config->get('concrete.security.trusted_proxies.ips')) {
Request::setTrustedProxies($trustedProxiesIps);
}

/**
* ----------------------------------------------------------------------------
* Obtain the Request object.
Expand Down