Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53048ce

Browse files
committed
Log potential redirect loops caused by forced HTTPS
If the developer forgets/fails to set "trusted_proxies" properly, forcing thehttps channel can cause infinite redirect loops. This change will hopefullyhelp them identify the problem faster.See#27603
1 parentb560883 commit53048ce

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/Symfony/Component/Security/Http/Firewall/ChannelListener.php‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ public function handle(GetResponseEvent $event)
4646

4747
if ('https' ===$channel && !$request->isSecure()) {
4848
if (null !==$this->logger) {
49-
$this->logger->info('Redirecting to HTTPS.');
49+
if ('https' ===$request->headers->get('X-Forwarded-Proto')) {
50+
$this->logger->info('Redirecting to HTTPS. ("X-Forwarded-Proto" header is set to "https" - did you set "trusted_proxies" correctly?)');
51+
}elseif (false !==strpos($request->headers->get('Forwarded'),'proto=https')) {
52+
$this->logger->info('Redirecting to HTTPS. ("Forwarded" header is set to "proto=https" - did you set "trusted_proxies" correctly?)');
53+
}else {
54+
$this->logger->info('Redirecting to HTTPS.');
55+
}
5056
}
5157

5258
$response =$this->authenticationEntryPoint->start($request);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp