Skip to content

Commit

Permalink
Only cache sharepic when request to Github server was successful
Browse files Browse the repository at this point in the history
  • Loading branch information
floscher committed Aug 1, 2024
1 parent 6196919 commit f7f401b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/src/routes/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ router.get("/github-sharepic", async (req, res) => {
.then((r) => {
r.arrayBuffer()
.then((buf) => {
cachedSharepic = { url, bytes: new Uint8Array(buf) };
if (r.status === 200) {
cachedSharepic = { url, bytes: new Uint8Array(buf) };
}
sendCachedBytesOrNotFound();
})
.catch(sendCachedBytesOrNotFound);
Expand Down

0 comments on commit f7f401b

Please sign in to comment.