mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 12:44:22 +00:00
fix(schemas): accept empty-string fingerprint on externalProxy
The External Proxy form offers a "Default" option with value '' for the uTLS fingerprint dropdown, but UtlsFingerprintSchema.optional() rejects empty strings (only undefined or a valid enum member). Saving an inbound with externalProxy rows failed with `expected one of "360"|"chrome"|...`. Preprocess '' to undefined before the optional enum, matching the existing pattern used for VmessSecuritySchema.
This commit is contained in:
parent
66b80fb81b
commit
470efb7a64
1 changed files with 4 additions and 1 deletions
|
|
@ -17,7 +17,10 @@ export const ExternalProxyEntrySchema = z.object({
|
|||
port: PortSchema.default(443),
|
||||
remark: z.string().default(''),
|
||||
sni: z.string().optional(),
|
||||
fingerprint: UtlsFingerprintSchema.optional(),
|
||||
fingerprint: z.preprocess(
|
||||
(val) => (val === '' ? undefined : val),
|
||||
UtlsFingerprintSchema.optional(),
|
||||
),
|
||||
alpn: z.array(AlpnSchema).optional(),
|
||||
});
|
||||
export type ExternalProxyEntry = z.infer<typeof ExternalProxyEntrySchema>;
|
||||
|
|
|
|||
Loading…
Reference in a new issue