Skip to content

Commit 700b8cd

Browse files
committed
fix: morgan res-body check
1 parent 119691c commit 700b8cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/test-server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ morgan.token("body", function (req, res) {
393393
});
394394

395395
morgan.token("res-body", function (req, res) {
396-
return typeof res.__custombody__ ? res.__custombody__ : JSON.stringify(res.__custombody__);
396+
return typeof res.__custombody__ === "string" ? res.__custombody__ : JSON.stringify(res.__custombody__);
397397
});
398398

399399
const app = express();

0 commit comments

Comments
 (0)