Loading CHANGES.md +28 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,10 @@ Version 1.2.17 To be released. - Fedify no more depends on `node:punycode` module, which is deprecated in Node.js. Now it uses the built-in `node:url` module instead. [[#212], [#214] by Fróði Karlsson] Version 1.2.16 -------------- Loading Loading @@ -327,6 +331,16 @@ Released on October 31, 2024. [#118]: https://github.com/dahlia/fedify/issues/118 Version 1.1.17 -------------- Released on March 9, 2025. - Fedify no more depends on `node:punycode` module, which is deprecated in Node.js. Now it uses the built-in `node:url` module instead. [[#212], [#214] by Fróði Karlsson] Version 1.1.16 -------------- Loading Loading @@ -686,6 +700,19 @@ Released on October 20, 2024. [#150]: https://github.com/dahlia/fedify/issues/150 Version 1.0.20 -------------- Released on March 9, 2025. - Fedify no more depends on `node:punycode` module, which is deprecated in Node.js. Now it uses the built-in `node:url` module instead. [[#212], [#214] by Fróði Karlsson] [#212]: https://github.com/fedify-dev/fedify/issues/212 [#214]: https://github.com/fedify-dev/fedify/pull/214 Version 1.0.19 -------------- Loading Loading @@ -2839,4 +2866,4 @@ Version 0.1.0 Initial release. Released on March 8, 2024. <!-- cSpell: ignore Dogeon Fabien Wressell Emelia --> <!-- cSpell: ignore Dogeon Fabien Wressell Emelia Fróði Karlsson --> src/vocab/actor.ts +2 −2 Original line number Diff line number Diff line import { toASCII, toUnicode } from "node:punycode"; import { domainToASCII, domainToUnicode } from "node:url"; import { lookupWebFinger } from "../webfinger/lookup.ts"; import { Application, Group, Organization, Person, Service } from "./vocab.ts"; Loading Loading @@ -190,7 +190,7 @@ export function normalizeActorHandle( throw new TypeError("Invalid actor handle."); } domain = domain.toLowerCase(); domain = options.punycode ? toASCII(domain) : toUnicode(domain); domain = options.punycode ? domainToASCII(domain) : domainToUnicode(domain); domain = domain.toLowerCase(); const user = handle.substring(0, atPos); return options.trimLeadingAt ? `${user}@${domain}` : `@${user}@${domain}`; Loading src/webfinger/handler.ts +4 −2 Original line number Diff line number Diff line import { getLogger } from "@logtape/logtape"; import { toASCII } from "node:punycode"; import { domainToASCII } from "node:url"; import type { ActorDispatcher, ActorHandleMapper, Loading Loading @@ -74,7 +74,9 @@ export async function handleWebFinger<TContextData>( const uriParsed = context.parseUri(resourceUrl); if (uriParsed?.type != "actor") { const match = /^acct:([^@]+)@([^@]+)$/.exec(resource); if (match == null || toASCII(match[2].toLowerCase()) != context.url.host) { if ( match == null || domainToASCII(match[2].toLowerCase()) != context.url.host ) { return await onNotFound(request); } const username = match[1]; Loading Loading
CHANGES.md +28 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,10 @@ Version 1.2.17 To be released. - Fedify no more depends on `node:punycode` module, which is deprecated in Node.js. Now it uses the built-in `node:url` module instead. [[#212], [#214] by Fróði Karlsson] Version 1.2.16 -------------- Loading Loading @@ -327,6 +331,16 @@ Released on October 31, 2024. [#118]: https://github.com/dahlia/fedify/issues/118 Version 1.1.17 -------------- Released on March 9, 2025. - Fedify no more depends on `node:punycode` module, which is deprecated in Node.js. Now it uses the built-in `node:url` module instead. [[#212], [#214] by Fróði Karlsson] Version 1.1.16 -------------- Loading Loading @@ -686,6 +700,19 @@ Released on October 20, 2024. [#150]: https://github.com/dahlia/fedify/issues/150 Version 1.0.20 -------------- Released on March 9, 2025. - Fedify no more depends on `node:punycode` module, which is deprecated in Node.js. Now it uses the built-in `node:url` module instead. [[#212], [#214] by Fróði Karlsson] [#212]: https://github.com/fedify-dev/fedify/issues/212 [#214]: https://github.com/fedify-dev/fedify/pull/214 Version 1.0.19 -------------- Loading Loading @@ -2839,4 +2866,4 @@ Version 0.1.0 Initial release. Released on March 8, 2024. <!-- cSpell: ignore Dogeon Fabien Wressell Emelia --> <!-- cSpell: ignore Dogeon Fabien Wressell Emelia Fróði Karlsson -->
src/vocab/actor.ts +2 −2 Original line number Diff line number Diff line import { toASCII, toUnicode } from "node:punycode"; import { domainToASCII, domainToUnicode } from "node:url"; import { lookupWebFinger } from "../webfinger/lookup.ts"; import { Application, Group, Organization, Person, Service } from "./vocab.ts"; Loading Loading @@ -190,7 +190,7 @@ export function normalizeActorHandle( throw new TypeError("Invalid actor handle."); } domain = domain.toLowerCase(); domain = options.punycode ? toASCII(domain) : toUnicode(domain); domain = options.punycode ? domainToASCII(domain) : domainToUnicode(domain); domain = domain.toLowerCase(); const user = handle.substring(0, atPos); return options.trimLeadingAt ? `${user}@${domain}` : `@${user}@${domain}`; Loading
src/webfinger/handler.ts +4 −2 Original line number Diff line number Diff line import { getLogger } from "@logtape/logtape"; import { toASCII } from "node:punycode"; import { domainToASCII } from "node:url"; import type { ActorDispatcher, ActorHandleMapper, Loading Loading @@ -74,7 +74,9 @@ export async function handleWebFinger<TContextData>( const uriParsed = context.parseUri(resourceUrl); if (uriParsed?.type != "actor") { const match = /^acct:([^@]+)@([^@]+)$/.exec(resource); if (match == null || toASCII(match[2].toLowerCase()) != context.url.host) { if ( match == null || domainToASCII(match[2].toLowerCase()) != context.url.host ) { return await onNotFound(request); } const username = match[1]; Loading