|
@@ -69,9 +69,10 @@ class ClashMeta
|
|
|
$config['proxy-groups'][$k]['proxies'] = array_merge($config['proxy-groups'][$k]['proxies'], $proxies);
|
|
|
}
|
|
|
// Force the current subscription domain to be a direct rule
|
|
|
- $subsDomain = $_SERVER['SERVER_NAME'];
|
|
|
- $subsDomainRule = "DOMAIN,{$subsDomain},DIRECT";
|
|
|
- array_unshift($config['rules'], $subsDomainRule);
|
|
|
+ $subsDomain = $_SERVER['HTTP_HOST'];
|
|
|
+ if ($subsDomain) {
|
|
|
+ array_unshift($config['rules'], "DOMAIN,{$subsDomain},DIRECT");
|
|
|
+ }
|
|
|
|
|
|
$yaml = Yaml::dump($config);
|
|
|
$yaml = str_replace('$app_name', config('v2board.app_name', 'V2Board'), $yaml);
|