Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
guyutongxue committed Jan 24, 2025
1 parent f6a0a68 commit e9d79af
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions api/v2/data/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ export default async function handler(req, res) {
.send("Bad request (multiple id)");
return;
}
const { accept } = req.headers;
if (accept.includes("image/webp")) {
const response = await fetch(`https://gi-tcg-card-data-img.vercel.app/${id}.webp`);
if (id.endsWith(".webp")) {
const response = await fetch(`https://gi-tcg-card-data-img.vercel.app/${id}`);
res.status(200).send(response);
return;
}
Expand Down

0 comments on commit e9d79af

Please sign in to comment.