From a7318de30741b9437b83876d43be6d0f909a8178 Mon Sep 17 00:00:00 2001 From: mei23 Date: Thu, 10 May 2018 01:08:33 +0900 Subject: [PATCH] Fix cause error in case preview has data URI --- src/server/web/url-preview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/web/url-preview.ts b/src/server/web/url-preview.ts index 041c475a4..cd53837a2 100644 --- a/src/server/web/url-preview.ts +++ b/src/server/web/url-preview.ts @@ -14,7 +14,7 @@ module.exports = async (ctx: Koa.Context) => { function wrap(url: string): string { return url != null - ? url.startsWith('https://') + ? url.startsWith('https://') || url.startsWith('data:') ? url : `https://images.weserv.nl/?url=${encodeURIComponent(url.replace(/^http:\/\//, ''))}` : null;