Compare commits

...

2 Commits

4 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,11 @@
# Changelog
## 2025-01-28 - 3.0.54 - fix(servertools)
Fixed an issue with compression results handling in HandlerStatic where content was always being written even if not compressed.
- Corrected the double writing of response in HandlerStatic.
- Ensured that file buffers are only conditionally written based on compression availability.
## 2024-12-26 - 3.0.53 - fix(infohtml)
Remove Sentry script and logo from HTML template

View File

@ -1,6 +1,6 @@
{
"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.",
"type": "module",
"exports": {

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();
});
}