1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-02 00:38:14 +09:00

Fix cause error in case preview has data URI

This commit is contained in:
mei23 2018-05-10 01:08:33 +09:00
parent d261fdbbc0
commit f40e1ff0cc

View File

@ -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;