ITADN

Some invalid schemas pass validation after updating to 1.1.20

#1574Closedsleewoo 创建于 2026-04-09
S
sleewoocommented
Hello, some test cases started failing after update, check commented values on `"invalid payload"` case, they should not validate: ```ts describe("email", async () => { const schema = await importSchema("string/format/email", "json.POST"); test("valid payload", () => { for (const value of [ "test@example.com", "user.name+tag@domain.co.uk", "a@b.cd", "user@sub.domain.com", "first.last@example.org", ] as const) { expect(schema?.check({ value })).toEqual(true); } }); test("invalid payload", () => { for (const value of [ "invalid", "test@", "@domain.com", // "test@.com", // "user@.domain.com", // "user@domain.", "user@domain..com", ] as const) { expect(schema?.check({ value }), value).toEqual(false); } }); }); describe("idn-email", async () => { const schema = await importSchema("string/format/idn-email", "json.POST"); test("valid payload", () => { for (const value of [ "test@例子.测试", // Chinese domain "user@müller.example.com", // German umlaut in subdomain "test@스타벅스.코리아", // Korean domain "user@παράδειγμα.δοκιμή", // Greek domain "test@россия.рф", // Cyrillic domain "user@東京.jp", // Japanese domain "test@fußball.example.com", // German eszett in subdomain "user@café.fr", // French accent "test@bücher.example.com", // German umlaut "user@example.com", // Regular ASCII email (should also work) ] as const) { expect(schema?.check({ value })).toEqual(true); } }); test("invalid payload", () => { for (const value of [ "invalid", "test@", "@例子.测试", // "user@.例子.测试", // "test@例子.", // incomplete domain "user@..例子.测试", // double dot // "test@例子.测试.", // trailing dot // "user@-例子.测试", // leading hyphen in label // "test@例子.-测试", // leading hyphen "user@例子.测试 ", // trailing space ] as const) { expect(schema?.check({ value }), value).toEqual(false); } }); }); ``` those invalid values was correctly rejected before 1.1.20 some regression?
关闭于 2026-04-09 4 条评论