mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-17 13:08:36 +03:00
refactor: change vless validation logic
This commit is contained in:
@@ -9,6 +9,13 @@ export function validateTrojanUrl(url: string): ValidationResult {
|
||||
};
|
||||
}
|
||||
|
||||
if (!url || /\s/.test(url)) {
|
||||
return {
|
||||
valid: false,
|
||||
message: 'Invalid Trojan URL: must not contain spaces',
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const parsedUrl = new URL(url);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user