fix: fix webview & improve download progress

This commit is contained in:
tdurieux
2024-04-03 18:25:33 +01:00
parent 83c55fdfbf
commit 1d4bab7866
11 changed files with 206 additions and 75 deletions
+3 -3
View File
@@ -10,7 +10,7 @@ import config from "../../config";
import { pipeline, Readable, Transform } from "stream";
import ArchiveStreamToS3 from "decompress-stream-to-s3";
import { Response } from "express";
import { contentType } from "mime-types";
import { lookup } from "mime-types";
import * as archiver from "archiver";
import { trace } from "@opentelemetry/api";
import { dirname, basename, join } from "path";
@@ -170,7 +170,7 @@ export default class S3Storage extends StorageBase {
lastModified: info.LastModified,
contentType: info.ContentType
? info.ContentType
: (contentType(path) as string),
: (lookup(path) as string),
};
} finally {
span.end();
@@ -226,7 +226,7 @@ export default class S3Storage extends StorageBase {
Bucket: config.S3_BUCKET,
Key: join(this.repoPath(repoId), path),
Body: data,
ContentType: contentType(path).toString(),
ContentType: lookup(path).toString(),
};
if (source) {
params.Tagging = `source=${source}`;