diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2023-01-25 14:22:26 +0000 |
|---|---|---|
| committer | tamaina <tamaina@hotmail.co.jp> | 2023-01-25 14:22:26 +0000 |
| commit | 605b0f27e4cfe95dfa5201b0dbf07a5dbcc8e806 (patch) | |
| tree | 5e79388ef2a7b7a76be56d897b3590ce2d1a88dd /packages/backend/src/core/FetchInstanceMetadataService.ts | |
| parent | fix (diff) | |
| parent | :art: (diff) | |
| download | sharkey-605b0f27e4cfe95dfa5201b0dbf07a5dbcc8e806.tar.gz sharkey-605b0f27e4cfe95dfa5201b0dbf07a5dbcc8e806.tar.bz2 sharkey-605b0f27e4cfe95dfa5201b0dbf07a5dbcc8e806.zip | |
Merge branch 'develop' into emoji-re
Diffstat (limited to 'packages/backend/src/core/FetchInstanceMetadataService.ts')
| -rw-r--r-- | packages/backend/src/core/FetchInstanceMetadataService.ts | 5 |
1 files changed, 4 insertions, 1 deletions
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; |