This commit is contained in:
syuilo
2018-05-06 02:08:27 +09:00
parent a64817cea1
commit 650f79d0fd
2 changed files with 4 additions and 3 deletions

View File

@@ -14,6 +14,8 @@ module.exports = async (ctx: Koa.Context) => {
function wrap(url: string): string {
return url != null
? `https://images.weserv.nl/?url=${url.replace(/^https?:\/\//, '')}`
? url.startsWith('https://')
? url
: `https://images.weserv.nl/?url=${url.replace(/^http:\/\//, '')}`
: null;
}