mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 10:52:53 +00:00
fix: always send a response
This commit is contained in:
@@ -108,7 +108,6 @@ export default class S3Storage implements StorageBase {
|
||||
Key: p,
|
||||
});
|
||||
const s = await this.client().send(command);
|
||||
s.ContentLength;
|
||||
res.status(200);
|
||||
if (s.ContentType) {
|
||||
res.contentType(s.ContentType);
|
||||
@@ -116,7 +115,11 @@ export default class S3Storage implements StorageBase {
|
||||
if (s.ContentLength) {
|
||||
res.set("Content-Length", s.ContentLength.toString());
|
||||
}
|
||||
(s.Body as Readable)?.pipe(res);
|
||||
if (s.Body) {
|
||||
(s.Body as Readable)?.pipe(res);
|
||||
} else {
|
||||
res.end();
|
||||
}
|
||||
} catch (error) {
|
||||
try {
|
||||
res.status(500);
|
||||
|
||||
Reference in New Issue
Block a user