From 1b37ce1abd9481ddfb86b06bc10749660df8e499 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 4 Jul 2017 11:35:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0https=5Fagent=5Fname=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=8F=82=E6=95=B0=20=E6=94=B9=E8=BF=9BRequest?= =?UTF-8?q?=E7=B1=BB=E7=9A=84isssl=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- convention.php | 2 ++ library/think/Request.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/convention.php b/convention.php index 8081dc35..4bde7d88 100644 --- a/convention.php +++ b/convention.php @@ -74,6 +74,8 @@ return [ 'pathinfo_fetch' => ['ORIG_PATH_INFO', 'REDIRECT_PATH_INFO', 'REDIRECT_URL'], // pathinfo分隔符 'pathinfo_depr' => '/', + // HTTPS代理标识 + 'https_agent_name' => '', // URL伪静态后缀 'url_html_suffix' => 'html', // URL普通方式参数 用于自动生成 diff --git a/library/think/Request.php b/library/think/Request.php index f5bab0bb..7e9949a8 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -1215,6 +1215,8 @@ class Request return true; } elseif (isset($server['HTTP_X_FORWARDED_PROTO']) && 'https' == $server['HTTP_X_FORWARDED_PROTO']) { return true; + } elseif (Config::get('https_agent_name') && isset($server[Config::get('https_agent_name')])) { + return true; } return false; }