Link previews: clean up AbortSignal types
This commit is contained in:
parent
fd579d62e4
commit
e4a632f601
4 changed files with 6 additions and 8 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue