Fix can't preview some url
This commit is contained in:
parent
6b0a42af27
commit
d261fdbbc0
@ -45,7 +45,7 @@ export default Vue.extend({
|
|||||||
} else if (url.hostname == 'youtu.be') {
|
} else if (url.hostname == 'youtu.be') {
|
||||||
this.youtubeId = url.pathname;
|
this.youtubeId = url.pathname;
|
||||||
} else {
|
} else {
|
||||||
fetch('/url?url=' + this.url).then(res => {
|
fetch('/url?url=' + encodeURIComponent(this.url)).then(res => {
|
||||||
res.json().then(info => {
|
res.json().then(info => {
|
||||||
this.title = info.title;
|
this.title = info.title;
|
||||||
this.description = info.description;
|
this.description = info.description;
|
||||||
|
@ -16,6 +16,6 @@ function wrap(url: string): string {
|
|||||||
return url != null
|
return url != null
|
||||||
? url.startsWith('https://')
|
? url.startsWith('https://')
|
||||||
? url
|
? url
|
||||||
: `https://images.weserv.nl/?url=${url.replace(/^http:\/\//, '')}`
|
: `https://images.weserv.nl/?url=${encodeURIComponent(url.replace(/^http:\/\//, ''))}`
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user