From 3b753ecfbfe1f7c5d9a1a2e0137521d23608abfc Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Tue, 10 Feb 2026 22:44:17 -0600 Subject: [PATCH] test(traefik): add tests for punycode conversion of Russian IDNs - Added tests to verify the conversion of Russian Cyrillic domains and subdomains with IDN TLDs to punycode format, ensuring proper handling in router configurations. - Confirmed that non-ASCII parts are correctly converted while ASCII parts remain unchanged. --- apps/dokploy/__test__/traefik/traefik.test.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/apps/dokploy/__test__/traefik/traefik.test.ts b/apps/dokploy/__test__/traefik/traefik.test.ts index 642533d61..9121dc8a1 100644 --- a/apps/dokploy/__test__/traefik/traefik.test.ts +++ b/apps/dokploy/__test__/traefik/traefik.test.ts @@ -299,3 +299,27 @@ test("ASCII domain remains unchanged", async () => { expect(router.rule).toContain("Host(`example.com`)"); }); + +test("Russian Cyrillic label with .ru TLD is converted to punycode", async () => { + const router = await createRouterConfig( + baseApp, + { ...baseDomain, host: "сайт.ru" }, + "web", + ); + + // сайт in punycode is xn--80aswg + expect(router.rule).toContain("Host(`xn--80aswg.ru`)"); + expect(router.rule).not.toContain("сайт"); +}); + +test("Subdomain with Russian IDN TLD converts non-ASCII part to punycode", async () => { + const router = await createRouterConfig( + baseApp, + { ...baseDomain, host: "app.тест.рф" }, + "web", + ); + + // app stays ASCII, тест.рф becomes xn--e1aybc.xn--p1ai + expect(router.rule).toContain("Host(`app.xn--e1aybc.xn--p1ai`)"); + expect(router.rule).not.toContain("тест.рф"); +});