This commit is contained in:
Hailey
2024-06-26 16:53:49 -07:00
parent d2f4f32b25
commit f8d11aeed0
+3 -3
View File
@@ -9,10 +9,10 @@ export async function resolveShortLink(shortLink: string) {
method: 'GET',
signal: controller.signal,
})
if (res.status !== 301) {
return res.url
if (res.status !== 200) {
return shortLink
}
return res.headers.get('Location')
return res.url
} catch (e: unknown) {
logger.error('Failed to resolve short link', {safeMessage: e})
return null