Skip to content

Commit c079756

Browse files
committed
chore: fix build errors
1 parent a37e8a2 commit c079756

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/payload/src/uploads/getExternalFile.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ export const getExternalFile = async ({ data, req, uploadConfig }: Args): Promis
2727
if (allowList.length === 0 || !isURLAllowed(fileURL, allowList)) {
2828
ssrfFilter({ url: fileURL })
2929
}
30-
} catch (error) {
30+
} catch (ignore) {
3131
throw new APIError(`Failed to fetch file from filtered url, ${fileURL}`, 400)
3232
}
3333

3434
const headers = uploadConfig.externalFileHeaderFilter
3535
? uploadConfig.externalFileHeaderFilter(Object.fromEntries(new Headers(req.headers)))
36-
: { cookie: req.headers?.get('cookie') }
36+
: { cookie: req.headers.get('cookie')! }
3737

3838
const res = await fetch(fileURL, {
3939
credentials: 'include',
@@ -50,7 +50,7 @@ export const getExternalFile = async ({ data, req, uploadConfig }: Args): Promis
5050
return {
5151
name: filename,
5252
data: Buffer.from(data),
53-
mimetype: res.headers.get('content-type') || undefined,
53+
mimetype: res.headers.get('content-type') || undefined!,
5454
size: Number(res.headers.get('content-length')) || 0,
5555
}
5656
}

0 commit comments

Comments
 (0)