mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Add support for X-Forwarded-Proto checking SSL (Fixes #1416)
De-facto standard for identifying the originating protocol of an HTTP request through a reverse proxy or load balancer. http://www.geekisp.com/faq/6_65_en.html
This commit is contained in:
parent
e7266535c5
commit
c61f6540fb
@ -477,10 +477,15 @@ class Director implements TemplateGlobalProvider {
|
||||
}
|
||||
}
|
||||
|
||||
if((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')) {
|
||||
if(isset($_SERVER['X-Forwarded-Proto'])) {
|
||||
if(strtolower($_SERVER['X-Forwarded-Proto']) == "https") {
|
||||
return true;
|
||||
}
|
||||
else if(isset($_SERVER['SSL'])) {
|
||||
}
|
||||
|
||||
if((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')) {
|
||||
return true;
|
||||
} else if(isset($_SERVER['SSL'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user