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.
This commit is contained in:
Abhishek S Lal
2026-02-11 21:16:41 +05:30
committed by GitHub
parent 6f4489a8f3
commit bac51191ee

View File

@@ -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)) {