fix(route/smartlink): API returns application/json (#21112)

This commit is contained in:
Qiang Huang
2026-02-11 17:52:25 +08:00
committed by GitHub
parent 57c0d1fd28
commit 4b9ef7b723
+1 -3
View File
@@ -66,9 +66,7 @@ async function handler(ctx) {
const site = ctx.req.param('site');
const link = `https://smartlink.bio/api/instagram/${site}/posts`;
const data = await ofetch(link);
// the API returns text/plain as MIME type
// Parse the JSON string into an array
const parsedData = JSON.parse(data);
const parsedData = data;
const items = parsedData.map((item) => ({
title: getTitle(item),
link: item.smartlink.split('?')[0],