Various bug fixes for URI format parsing

This commit is contained in:
Peng-YM
2022-06-20 17:00:57 +08:00
parent fc86f3e15d
commit da44dc9cab
7 changed files with 68 additions and 74 deletions

View File

@@ -144,9 +144,6 @@ function trojan(proxy) {
}
}
// tls
appendIfPresent(`,over-tls=${proxy.tls}`, 'tls');
// tls fingerprint
appendIfPresent(
`,tls-cert-sha256=${proxy['tls-fingerprint']}`,

View File

@@ -25,5 +25,6 @@ export class Result {
}
export function isPresent(obj, attr) {
return typeof _.get(obj, attr) !== 'undefined';
const data = _.get(obj, attr);
return typeof data !== 'undefined' && data !== null;
}