mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-07 19:22:14 +09:00
feat(blocklist): add url-domain host patterns (#3164)
This commit is contained in:
@@ -340,13 +340,13 @@ export const BanUrlRequest = z.object({
|
||||
export type BanUrlRequest = z.infer<typeof BanUrlRequest>;
|
||||
|
||||
export const BanUrlDomainRequest = z.object({
|
||||
domain: createStringType(1, 253)
|
||||
.refine(
|
||||
(v) => /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i.test(v),
|
||||
'Must be a valid domain',
|
||||
)
|
||||
.describe('Domain to ban (e.g. example.com)'),
|
||||
match_subdomains: z.boolean().default(true).describe('If true, any subdomain rooted at this domain is also banned'),
|
||||
domain: createStringType(1, 253).describe(
|
||||
'Domain to ban (e.g. example.com), or a pattern whose leftmost label contains * under a registrable domain (e.g. *shop*.example.com). Internationalized names are stored in ASCII form.',
|
||||
),
|
||||
match_subdomains: z
|
||||
.boolean()
|
||||
.default(true)
|
||||
.describe('If true, any subdomain rooted at this domain, or at a host the pattern matches, is also banned'),
|
||||
category: createStringType(1, 64).optional().describe('Category / source slug (defaults to "manual")'),
|
||||
severity: z
|
||||
.number()
|
||||
|
||||
Reference in New Issue
Block a user