Skip to content

Commit

Permalink
Shows player fallback image even when picture downloading is disabled (
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasdotcom authored May 23, 2024
1 parent 85651de commit 9442592
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pages/api/picture/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ export default async function handler(
Readable.fromWeb(r.body).pipe(res);
})
.catch(() => {
res.redirect("/playerFallback.png");
const data = statSync("./public/playerFallback.png");
const stream = createReadStream("./public/playerFallback.png");
res.setHeader("Content-Length", data.size);
res.writeHead(200);
stream.pipe(res);
});
connection.end();
} else {
Expand Down

0 comments on commit 9442592

Please sign in to comment.