mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 04:33:50 +01:00
Fix can't preview some url
This commit is contained in:
parent
4b02600297
commit
e566d87aa8
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user