@anhocva214/logzen 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -2
- package/package.json +1 -1
- package/src/index.ts +1 -2
package/dist/index.js
CHANGED
@@ -55,8 +55,7 @@ function logzen(options = {}) {
|
|
55
55
|
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
56
56
|
}
|
57
57
|
let responseBody = Buffer.concat(chunks).toString("utf8");
|
58
|
-
|
59
|
-
if (/^\s*<\s*html/i.test(responseBody)) {
|
58
|
+
if (/^\s*(<!doctype\s+html|<html)/i.test(responseBody)) {
|
60
59
|
responseBody = "<HTML>";
|
61
60
|
}
|
62
61
|
const duration = Date.now() - startTime;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@anhocva214/logzen",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.3",
|
4
4
|
"description": "A lightweight logging middleware for Node.js/Express written in TypeScript that logs request and response details in JSON format.",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
package/src/index.ts
CHANGED
@@ -46,8 +46,7 @@ export function logzen(options: LogZenOptions = {}) {
|
|
46
46
|
}
|
47
47
|
let responseBody = Buffer.concat(chunks).toString("utf8");
|
48
48
|
|
49
|
-
|
50
|
-
if (/^\s*<\s*html/i.test(responseBody)) {
|
49
|
+
if (/^\s*(<!doctype\s+html|<html)/i.test(responseBody)) {
|
51
50
|
responseBody = "<HTML>";
|
52
51
|
}
|
53
52
|
|