From bac51191ee15f042e81eb539a174379fe9fed380 Mon Sep 17 00:00:00 2001 From: Abhishek S Lal Date: Wed, 11 Feb 2026 21:16:41 +0530 Subject: [PATCH] fix: enhance HTTP response status validation in stringifyHttpRequest function (#7117) Updated the response status handling to ensure it is a positive integer before assignment, improving data integrity in HTTP request stringification. --- .../src/formats/yml/items/stringifyHttpRequest.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/bruno-filestore/src/formats/yml/items/stringifyHttpRequest.ts b/packages/bruno-filestore/src/formats/yml/items/stringifyHttpRequest.ts index 809601ce9..35cb03eca 100644 --- a/packages/bruno-filestore/src/formats/yml/items/stringifyHttpRequest.ts +++ b/packages/bruno-filestore/src/formats/yml/items/stringifyHttpRequest.ts @@ -174,8 +174,9 @@ const stringifyHttpRequest = (item: BrunoItem): string => { if (example.response) { ocExample.response = {}; - if (example.response.status !== undefined && example.response.status !== null && isNumber(example.response.status)) { - ocExample.response.status = Number(example.response.status); + const statusNum = Number(example.response.status); + if (Number.isInteger(statusNum) && statusNum > 0) { + ocExample.response.status = statusNum; } if (isNonEmptyString(example.response.statusText)) {