mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
域名绑定支持https检测
This commit is contained in:
@@ -13,6 +13,7 @@ namespace think;
|
|||||||
|
|
||||||
use think\App;
|
use think\App;
|
||||||
use think\Config;
|
use think\Config;
|
||||||
|
use think\exception\HttpException;
|
||||||
use think\Hook;
|
use think\Hook;
|
||||||
use think\Log;
|
use think\Log;
|
||||||
use think\Request;
|
use think\Request;
|
||||||
@@ -681,8 +682,12 @@ class Route
|
|||||||
}
|
}
|
||||||
if (!empty($item)) {
|
if (!empty($item)) {
|
||||||
self::$domain = true;
|
self::$domain = true;
|
||||||
|
// 解析子域名部署规则
|
||||||
list($rule, $option, $pattern) = $item;
|
list($rule, $option, $pattern) = $item;
|
||||||
// 子域名部署规则
|
if (!empty($option['https']) && !$request->isSsl()) {
|
||||||
|
// https检测
|
||||||
|
throw new HttpException(404, 'must use https request:' . $host);
|
||||||
|
}
|
||||||
if ($rule instanceof \Closure) {
|
if ($rule instanceof \Closure) {
|
||||||
// 执行闭包
|
// 执行闭包
|
||||||
$reflect = new \ReflectionFunction($rule);
|
$reflect = new \ReflectionFunction($rule);
|
||||||
|
|||||||
Reference in New Issue
Block a user