fix: resolve vmess http-opts headers null issue in subscription generation

This commit is contained in:
xboard
2025-09-12 10:45:31 +08:00
parent b14477098d
commit f289f68898
4 changed files with 21 additions and 10 deletions
+4 -2
View File
@@ -203,10 +203,12 @@ class Clash extends AbstractProtocol
case 'tcp':
$array['network'] = data_get($protocol_settings, 'network_settings.header.type');
if (data_get($protocol_settings, 'network_settings.header.type', 'none') !== 'none') {
$array['http-opts'] = [
if ($httpOpts = array_filter([
'headers' => data_get($protocol_settings, 'network_settings.header.request.headers'),
'path' => data_get($protocol_settings, 'network_settings.header.request.path', ['/'])
];
])) {
$array['http-opts'] = $httpOpts;
}
}
break;
case 'ws':