diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-05-13 03:08:33 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-05-13 03:08:33 +0900 |
| commit | 1836dd7312d9dca7944f166d0b749de326c538f1 (patch) | |
| tree | 6133c983594652f4afc82ba1427f94bf51ee7ea4 /src | |
| parent | Add note (diff) | |
| parent | Merge pull request #1576 from mei23/mei-preview (diff) | |
| download | sharkey-1836dd7312d9dca7944f166d0b749de326c538f1.tar.gz sharkey-1836dd7312d9dca7944f166d0b749de326c538f1.tar.bz2 sharkey-1836dd7312d9dca7944f166d0b749de326c538f1.zip | |
Merge branch 'master' of https://github.com/syuilo/misskey
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app/common/views/components/url-preview.vue | 2 | ||||
| -rw-r--r-- | src/server/web/url-preview.ts | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/client/app/common/views/components/url-preview.vue b/src/client/app/common/views/components/url-preview.vue index c2dc07b411..3bae6e5078 100644 --- a/src/client/app/common/views/components/url-preview.vue +++ b/src/client/app/common/views/components/url-preview.vue @@ -45,7 +45,7 @@ export default Vue.extend({ } else if (url.hostname == 'youtu.be') { this.youtubeId = url.pathname; } else { - fetch('/url?url=' + this.url).then(res => { + fetch('/url?url=' + encodeURIComponent(this.url)).then(res => { res.json().then(info => { this.title = info.title; this.description = info.description; diff --git a/src/server/web/url-preview.ts b/src/server/web/url-preview.ts index 8a5e934b1d..cd53837a25 100644 --- a/src/server/web/url-preview.ts +++ b/src/server/web/url-preview.ts @@ -14,8 +14,8 @@ 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=${url.replace(/^http:\/\//, '')}` + : `https://images.weserv.nl/?url=${encodeURIComponent(url.replace(/^http:\/\//, ''))}` : null; } |