diff options
| author | anatawa12 <anatawa12@icloud.com> | 2025-01-14 21:37:39 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-14 12:37:39 +0000 |
| commit | 145c6cf2b5285518e65db8a7098d1b570023fabb (patch) | |
| tree | 24387408d4fc9b9535494ea08f1557c1ce5e8ca7 /packages/backend/src/core/UtilityService.ts | |
| parent | feat(misskey-js): allow setting binaryType of WebSocket connection (#15190) (diff) | |
| download | sharkey-145c6cf2b5285518e65db8a7098d1b570023fabb.tar.gz sharkey-145c6cf2b5285518e65db8a7098d1b570023fabb.tar.bz2 sharkey-145c6cf2b5285518e65db8a7098d1b570023fabb.zip | |
fix: node.js の punycode モジュールが使用されている場所がある問題 (#15248)
* fix: punycode.js が使用されていない場所がある問題
* fix: use punycode/punycode.js on backend
* fix: use punycode/punycode.es6.js on backend
* fix: d.ts missing declare keyword
* chore: don't use punycode.js on backend
* update pnpm-lock.yaml
* chore: remove punycode.d.ts
* chore: use punycode.js instead of punycode npm package
* chore: bump psl to 1.15.0
* chore: bump nsfwjs to 4.2.0
4.2.1 is not usable because of https://github.com/infinitered/nsfwjs/issues/904
* chore: prevent loading node-fetch from tensorflow
* chore: DOMWindow['document'] => Document
IDK why DOMWindow['document'] fails, but might be related to tsc internal complexity limit
* fix: disable --trace-deprecation
---------
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/core/UtilityService.ts')
| -rw-r--r-- | packages/backend/src/core/UtilityService.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/backend/src/core/UtilityService.ts b/packages/backend/src/core/UtilityService.ts index 9a2ba72ed3..fcb750d3bf 100644 --- a/packages/backend/src/core/UtilityService.ts +++ b/packages/backend/src/core/UtilityService.ts @@ -3,8 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { URL } from 'node:url'; -import { toASCII } from 'punycode'; +import { URL, domainToASCII } from 'node:url'; import { Inject, Injectable } from '@nestjs/common'; import RE2 from 're2'; import { DI } from '@/di-symbols.js'; @@ -106,13 +105,13 @@ export class UtilityService { @bindThis public toPuny(host: string): string { - return toASCII(host.toLowerCase()); + return domainToASCII(host.toLowerCase()); } @bindThis public toPunyNullable(host: string | null | undefined): string | null { if (host == null) return null; - return toASCII(host.toLowerCase()); + return domainToASCII(host.toLowerCase()); } @bindThis |