mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-07 22:28:01 +02:00
fix: always send a response
This commit is contained in:
+5
-2
@@ -108,7 +108,6 @@ export default class S3Storage implements StorageBase {
|
|||||||
Key: p,
|
Key: p,
|
||||||
});
|
});
|
||||||
const s = await this.client().send(command);
|
const s = await this.client().send(command);
|
||||||
s.ContentLength;
|
|
||||||
res.status(200);
|
res.status(200);
|
||||||
if (s.ContentType) {
|
if (s.ContentType) {
|
||||||
res.contentType(s.ContentType);
|
res.contentType(s.ContentType);
|
||||||
@@ -116,7 +115,11 @@ export default class S3Storage implements StorageBase {
|
|||||||
if (s.ContentLength) {
|
if (s.ContentLength) {
|
||||||
res.set("Content-Length", s.ContentLength.toString());
|
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) {
|
} catch (error) {
|
||||||
try {
|
try {
|
||||||
res.status(500);
|
res.status(500);
|
||||||
|
|||||||
Reference in New Issue
Block a user