修复如果网站名称为中文的时候,CFW and Stash 不显示文件名或显示文件名乱码的问题

This commit is contained in:
coldice945 2022-05-19 23:01:11 +08:00
parent 84f8089604
commit 25cae43430
2 changed files with 2 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class Clash
$appName = config('v2board.app_name', 'V2Board');
header("subscription-userinfo: upload={$user['u']}; download={$user['d']}; total={$user['transfer_enable']}; expire={$user['expired_at']}");
header('profile-update-interval: 24');
header("content-disposition:attachment;filename={$appName}");
header("content-disposition:attachment;filename*=UTF-8''".rawurlencode($appName));
$defaultConfig = base_path() . '/resources/rules/default.clash.yaml';
$customConfig = base_path() . '/resources/rules/custom.clash.yaml';
if (\File::exists($customConfig)) {

View File

@ -24,6 +24,7 @@ class Stash
header("subscription-userinfo: upload={$user['u']}; download={$user['d']}; total={$user['transfer_enable']}; expire={$user['expired_at']}");
header('profile-update-interval: 24');
header("content-disposition: filename={$appName}");
header("content-disposition: filename*=UTF-8''".rawurlencode($appName));
// 暂时使用clash配置文件后续根据Stash更新情况更新
$defaultConfig = base_path() . '/resources/rules/default.clash.yaml';
$customConfig = base_path() . '/resources/rules/custom.clash.yaml';