Skip to content

Commit 7bb73fe

Browse files
committed
Merge tag '1.1.17' into 1.2-maintenance
Fedify 1.1.17
2 parents 031dff4 + 2e1cbb5 commit 7bb73fe

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

CHANGES.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Version 1.2.17
88

99
To be released.
1010

11+
- Fedify no more depends on `node:punycode` module, which is deprecated in
12+
Node.js. Now it uses the built-in `node:url` module instead.
13+
[[#212], [#214] by Fróði Karlsson]
14+
1115

1216
Version 1.2.16
1317
--------------
@@ -327,6 +331,16 @@ Released on October 31, 2024.
327331
[#118]: https://github.com/dahlia/fedify/issues/118
328332

329333

334+
Version 1.1.17
335+
--------------
336+
337+
Released on March 9, 2025.
338+
339+
- Fedify no more depends on `node:punycode` module, which is deprecated in
340+
Node.js. Now it uses the built-in `node:url` module instead.
341+
[[#212], [#214] by Fróði Karlsson]
342+
343+
330344
Version 1.1.16
331345
--------------
332346

@@ -686,6 +700,19 @@ Released on October 20, 2024.
686700
[#150]: https://github.com/dahlia/fedify/issues/150
687701

688702

703+
Version 1.0.20
704+
--------------
705+
706+
Released on March 9, 2025.
707+
708+
- Fedify no more depends on `node:punycode` module, which is deprecated in
709+
Node.js. Now it uses the built-in `node:url` module instead.
710+
[[#212], [#214] by Fróði Karlsson]
711+
712+
[#212]: https://github.com/fedify-dev/fedify/issues/212
713+
[#214]: https://github.com/fedify-dev/fedify/pull/214
714+
715+
689716
Version 1.0.19
690717
--------------
691718

@@ -2839,4 +2866,4 @@ Version 0.1.0
28392866

28402867
Initial release. Released on March 8, 2024.
28412868

2842-
<!-- cSpell: ignore Dogeon Fabien Wressell Emelia -->
2869+
<!-- cSpell: ignore Dogeon Fabien Wressell Emelia Fróði Karlsson -->

src/vocab/actor.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { toASCII, toUnicode } from "node:punycode";
1+
import { domainToASCII, domainToUnicode } from "node:url";
22
import { lookupWebFinger } from "../webfinger/lookup.ts";
33
import { Application, Group, Organization, Person, Service } from "./vocab.ts";
44

@@ -190,7 +190,7 @@ export function normalizeActorHandle(
190190
throw new TypeError("Invalid actor handle.");
191191
}
192192
domain = domain.toLowerCase();
193-
domain = options.punycode ? toASCII(domain) : toUnicode(domain);
193+
domain = options.punycode ? domainToASCII(domain) : domainToUnicode(domain);
194194
domain = domain.toLowerCase();
195195
const user = handle.substring(0, atPos);
196196
return options.trimLeadingAt ? `${user}@${domain}` : `@${user}@${domain}`;

src/webfinger/handler.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getLogger } from "@logtape/logtape";
2-
import { toASCII } from "node:punycode";
2+
import { domainToASCII } from "node:url";
33
import type {
44
ActorDispatcher,
55
ActorHandleMapper,
@@ -74,7 +74,9 @@ export async function handleWebFinger<TContextData>(
7474
const uriParsed = context.parseUri(resourceUrl);
7575
if (uriParsed?.type != "actor") {
7676
const match = /^acct:([^@]+)@([^@]+)$/.exec(resource);
77-
if (match == null || toASCII(match[2].toLowerCase()) != context.url.host) {
77+
if (
78+
match == null || domainToASCII(match[2].toLowerCase()) != context.url.host
79+
) {
7880
return await onNotFound(request);
7981
}
8082
const username = match[1];

0 commit comments

Comments
 (0)