mirror of
https://github.com/outline/outline.git
synced 2026-11-25 23:24:06 +03:00
fix: Do not attempt to download non-valid urls in document create/import
This commit is contained in:
1 parent
30a4303a8e
commit
864ddbd438
1 file changed
+7
@@ -381,6 +381,13 @@ export default class DocumentHelper {
|
||||
|
||||
await Promise.all(
|
||||
images.map(async (image) => {
|
||||
// Skip attempting to fetch images that are not valid urls
|
||||
try {
|
||||
new URL(image.src);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
const attachment = await attachmentCreator({
|
||||
name: image.alt ?? "image",
|
||||
url: image.src,
|
||||
|
||||
Reference in new issue
Block a user