Link previews: clean up AbortSignal types

This commit is contained in:
Evan Hahn 2021-06-08 15:55:37 -05:00 committed by GitHub
parent fd579d62e4
commit e4a632f601
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 8 deletions

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
import { RequestInit, Response } from 'node-fetch';
import { AbortSignal } from 'abort-controller';
import type { AbortSignal as AbortSignalForNodeFetch } from 'abort-controller';
import {
IMAGE_GIF,
@ -448,7 +448,7 @@ export async function fetchLinkPreviewMetadata(
Accept: 'text/html,application/xhtml+xml',
'User-Agent': USER_AGENT,
},
signal: abortSignal,
signal: abortSignal as AbortSignalForNodeFetch,
});
} catch (err) {
window.log.warn(
@ -545,7 +545,7 @@ export async function fetchLinkPreviewImage(
'User-Agent': USER_AGENT,
},
size: MAX_IMAGE_CONTENT_LENGTH,
signal: abortSignal,
signal: abortSignal as AbortSignalForNodeFetch,
});
} catch (err) {
window.log.warn('fetchLinkPreviewImage: failed to fetch image; bailing');