mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-27 21:26:18 +01:00
Remove resolveShortLink function
apply suggestions
This commit is contained in:
parent
41296b7413
commit
e775d4c5e7
1 changed files with 1 additions and 4 deletions
|
@ -48,15 +48,12 @@ async function getAccessToken() {
|
||||||
return access_token;
|
return access_token;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function resolveShortLink(url) {
|
|
||||||
return await getRedirectingURL(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function(obj) {
|
export default async function(obj) {
|
||||||
let url;
|
let url;
|
||||||
|
|
||||||
if (obj.shortLink) {
|
if (obj.shortLink) {
|
||||||
const resolvedUrl = await resolveShortLink(obj.shortLink);
|
const resolvedUrl = await getRedirectingURL(obj.shortLink);
|
||||||
if (!resolvedUrl) return { error: "fetch.short_link" };
|
if (!resolvedUrl) return { error: "fetch.short_link" };
|
||||||
url = new URL(resolvedUrl);
|
url = new URL(resolvedUrl);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue