mirror of
https://github.com/typecho/typecho.git
synced 2025-04-21 18:21:53 +02:00
fix error when use different protocol between reverse proxy and backend.
This commit is contained in:
parent
235888cc3e
commit
1e7e7e7997
@ -237,7 +237,9 @@ class Typecho_Request
|
||||
*/
|
||||
public static function isSecure()
|
||||
{
|
||||
return (!empty($_SERVER['HTTPS']) && 'off' != strtolower($_SERVER['HTTPS']))
|
||||
return (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && !strcasecmp('https', $_SERVER['HTTP_X_FORWARDED_PROTO']))
|
||||
|| (!empty($_SERVER['HTTP_X_FORWARDED_PORT']) && 443 == $_SERVER['HTTP_X_FORWARDED_PORT'])
|
||||
|| (!empty($_SERVER['HTTPS']) && 'off' != strtolower($_SERVER['HTTPS']))
|
||||
|| (!empty($_SERVER['SERVER_PORT']) && 443 == $_SERVER['SERVER_PORT'])
|
||||
|| (defined('__TYPECHO_SECURE__') && __TYPECHO_SECURE__);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user