Loading 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
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