fix: omit source content length for rewritten file responses

This commit is contained in:
tdurieux
2026-09-06 09:16:23 +02:00
parent 12c07641e0
commit 900516f225
2 changed files with 44 additions and 4 deletions
-4
View File
@@ -477,10 +477,6 @@ export default class AnonymizedFile {
if (!mime && data.isText) {
res.contentType("text/plain");
}
if (!data.wasAnonimized && this._file?.size) {
// the text files may be anonymized and therefore the size may be different
res.header("Content-Length", this._file?.size.toString());
}
});
const content = await this.content();
function handleStreamError(error: Error) {