diff options
| author | mei23 <m@m544.net> | 2018-05-09 20:14:34 +0900 |
|---|---|---|
| committer | mei23 <m@m544.net> | 2018-05-09 20:14:34 +0900 |
| commit | d261fdbbc0a35dc4ad88af0278d28db8baccec0e (patch) | |
| tree | a4903735473e40a963efff102ab631fe3cd85448 | |
| parent | Merge pull request #1575 from mei23/mei-listlm (diff) | |
| download | sharkey-d261fdbbc0a35dc4ad88af0278d28db8baccec0e.tar.gz sharkey-d261fdbbc0a35dc4ad88af0278d28db8baccec0e.tar.bz2 sharkey-d261fdbbc0a35dc4ad88af0278d28db8baccec0e.zip | |
Fix can't preview some url
| -rw-r--r-- | src/client/app/common/views/components/url-preview.vue | 2 | ||||
| -rw-r--r-- | src/server/web/url-preview.ts | 2 |
2 files changed, 2 insertions, 2 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..041c475a45 100644 --- a/src/server/web/url-preview.ts +++ b/src/server/web/url-preview.ts @@ -16,6 +16,6 @@ function wrap(url: string): string { return url != null ? url.startsWith('https://') ? url - : `https://images.weserv.nl/?url=${url.replace(/^http:\/\//, '')}` + : `https://images.weserv.nl/?url=${encodeURIComponent(url.replace(/^http:\/\//, ''))}` : null; } |