Skip to content

Commit df026d8

Browse files
committed
another try
1 parent 8db03c7 commit df026d8

File tree

1 file changed

+5
-1
lines changed
  • src/routes/api/Media/[requestedUsername]/[requestedMedia]

1 file changed

+5
-1
lines changed

src/routes/api/Media/[requestedUsername]/[requestedMedia]/+server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,14 @@ export async function GET(event) {
8888
} else {
8989
buffer = await readFile(filePath);
9090
}
91+
if (buffer == null) {
92+
error(503, {
93+
message: "Wait for this image!"
94+
});
95+
}
9196
return new Response(buffer, {
9297
headers: {
9398
'Content-Type': 'image/' + requestedFiletype, // or other appropriate content type
94-
'empty': (filePath == null) ? 'y' : 'n'
9599
}
96100
});
97101
} catch (imageError) {

0 commit comments

Comments
 (0)