diff --git a/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js b/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js index 04cb04d8..2cd5ccad 100644 --- a/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js +++ b/packages/bruno-app/src/components/RequestPane/RequestHeaders/index.js @@ -72,19 +72,27 @@ const RequestHeaders = ({ item, collection }) => { {headers && headers.length - ? headers.map((header, index) => { + ? headers.map((header) => { return ( - handleHeaderValueChange(e, header, 'name')} + theme={storedTheme} + onSave={onSave} + onChange={(newValue) => + handleHeaderValueChange( + { + target: { + value: newValue + } + }, + header, + 'name' + ) + } + onRun={handleRun} + collection={collection} /> diff --git a/packages/bruno-cli/src/runner/interpolate-vars.js b/packages/bruno-cli/src/runner/interpolate-vars.js index bfb0601d..ae30a7b2 100644 --- a/packages/bruno-cli/src/runner/interpolate-vars.js +++ b/packages/bruno-cli/src/runner/interpolate-vars.js @@ -51,7 +51,8 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces request.url = interpolate(request.url); forOwn(request.headers, (value, key) => { - request.headers[key] = interpolate(value); + delete request.headers[key]; + request.headers[interpolate(key)] = interpolate(value); }); if (request.headers['content-type'] === 'application/json') { diff --git a/packages/bruno-electron/src/ipc/network/interpolate-vars.js b/packages/bruno-electron/src/ipc/network/interpolate-vars.js index 7cdbcd25..fb022150 100644 --- a/packages/bruno-electron/src/ipc/network/interpolate-vars.js +++ b/packages/bruno-electron/src/ipc/network/interpolate-vars.js @@ -51,7 +51,8 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces request.url = interpolate(request.url); forOwn(request.headers, (value, key) => { - request.headers[key] = interpolate(value); + delete request.headers[key]; + request.headers[interpolate(key)] = interpolate(value); }); if (request.headers['content-type'] === 'application/json') {