summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authormei23 <m@m544.net>2018-05-10 01:08:33 +0900
committermei23 <m@m544.net>2018-05-10 01:08:33 +0900
commitf40e1ff0cc793e60ae72bdc430c24e372cd86015 (patch)
tree66e089fd863baeda7569729b7844929fa8d6da56 /src/server
parentFix can't preview some url (diff)
downloadsharkey-f40e1ff0cc793e60ae72bdc430c24e372cd86015.tar.gz
sharkey-f40e1ff0cc793e60ae72bdc430c24e372cd86015.tar.bz2
sharkey-f40e1ff0cc793e60ae72bdc430c24e372cd86015.zip
Fix cause error in case preview has data URI
Diffstat (limited to 'src/server')
-rw-r--r--src/server/web/url-preview.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/web/url-preview.ts b/src/server/web/url-preview.ts
index 041c475a45..cd53837a25 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;