From d4fb201d05fc4e0da85f21eece7cc6baf30b6d05 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 25 Jan 2023 12:00:04 +0900 Subject: fix(server): node-fetchおよびgotを使う以前の実装に戻す MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit see #9710 --- packages/backend/src/core/FetchInstanceMetadataService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages/backend/src/core/FetchInstanceMetadataService.ts') diff --git a/packages/backend/src/core/FetchInstanceMetadataService.ts b/packages/backend/src/core/FetchInstanceMetadataService.ts index cb9d099a22..35f30deeb4 100644 --- a/packages/backend/src/core/FetchInstanceMetadataService.ts +++ b/packages/backend/src/core/FetchInstanceMetadataService.ts @@ -2,6 +2,7 @@ import { URL } from 'node:url'; import { Inject, Injectable } from '@nestjs/common'; import { JSDOM } from 'jsdom'; import tinycolor from 'tinycolor2'; +import fetch from 'node-fetch'; import type { Instance } from '@/models/entities/Instance.js'; import type { InstancesRepository } from '@/models/index.js'; import { AppLockService } from '@/core/AppLockService.js'; @@ -190,7 +191,9 @@ export class FetchInstanceMetadataService { const faviconUrl = url + '/favicon.ico'; - const favicon = await this.httpRequestService.fetch(faviconUrl, {}, { noOkError: true }); + const favicon = await this.httpRequestService.send(faviconUrl, { + method: 'HEAD', + }, { throwErrorWhenResponseNotOk: false }); if (favicon.ok) { return faviconUrl; -- cgit v1.2.3-freya