fix(servertools): Fixed an issue with compression results handling in HandlerStatic where content was always being written even if not compressed.

This commit is contained in:
2025-01-28 10:32:17 +01:00
parent 2ea4139974
commit e552a48c02
3 changed files with 10 additions and 2 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@api.global/typedserver',
version: '3.0.53',
version: '3.0.54',
description: 'A TypeScript-based project for easy serving of static files with support for live reloading, compression, and typed requests.'
}

View File

@@ -134,8 +134,10 @@ export class HandlerStatic extends Handler {
res.status(200);
if (compressionResult?.compressionMethod) {
res.header('Content-Encoding', compressionResult.compressionMethod);
res.write(compressionResult.result);
} else {
res.write(fileBuffer);
}
res.write(compressionResult.result);
res.end();
});
}