diff --git a/packages/hoppscotch-app/components/graphql/RequestOptions.vue b/packages/hoppscotch-app/components/graphql/RequestOptions.vue index 07308358d..782a6158b 100644 --- a/packages/hoppscotch-app/components/graphql/RequestOptions.vue +++ b/packages/hoppscotch-app/components/graphql/RequestOptions.vue @@ -397,15 +397,15 @@ const editBulkHeadersLine = ( active: boolean } ) => { - const headers = bulkHeaders.value.split("\n") - if (item !== null) - headers.splice( - index, - 1, - `${item.active ? "" : "//"}${item.key}: ${item.value}` - ) - else headers.splice(index, 1) - bulkHeaders.value = headers.join("\n") + bulkHeaders.value = headers.value + .reduce((all, header, pIndex) => { + const current = + index === pIndex && item !== null + ? `${item.active ? "" : "//"}${item.key}: ${item.value}` + : `${header.active ? "" : "//"}${header.key}: ${header.value}` + return [...all, current] + }, []) + .join("\n") } const clearBulkEditor = () => { diff --git a/packages/hoppscotch-app/components/http/Headers.vue b/packages/hoppscotch-app/components/http/Headers.vue index 8ccf4e262..60f6dcf36 100644 --- a/packages/hoppscotch-app/components/http/Headers.vue +++ b/packages/hoppscotch-app/components/http/Headers.vue @@ -170,7 +170,7 @@