mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-22 06:31:18 +01:00
Merge pull request #225 from mirkogolze/feature/191-interpolate-header-names
#191 interpolate header names with variables
This commit is contained in:
commit
559fcb0806
@ -72,19 +72,27 @@ const RequestHeaders = ({ item, collection }) => {
|
||||
</thead>
|
||||
<tbody>
|
||||
{headers && headers.length
|
||||
? headers.map((header, index) => {
|
||||
? headers.map((header) => {
|
||||
return (
|
||||
<tr key={header.uid}>
|
||||
<td>
|
||||
<input
|
||||
type="text"
|
||||
autoComplete="off"
|
||||
autoCorrect="off"
|
||||
autoCapitalize="off"
|
||||
spellCheck="false"
|
||||
<SingleLineEditor
|
||||
value={header.name}
|
||||
className="mousetrap"
|
||||
onChange={(e) => handleHeaderValueChange(e, header, 'name')}
|
||||
theme={storedTheme}
|
||||
onSave={onSave}
|
||||
onChange={(newValue) =>
|
||||
handleHeaderValueChange(
|
||||
{
|
||||
target: {
|
||||
value: newValue
|
||||
}
|
||||
},
|
||||
header,
|
||||
'name'
|
||||
)
|
||||
}
|
||||
onRun={handleRun}
|
||||
collection={collection}
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -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') {
|
||||
|
@ -51,7 +51,7 @@ const template = [
|
||||
click: () =>
|
||||
openAboutWindow({
|
||||
product_name: 'Bruno',
|
||||
icon_path: join(__dirname, '../../resources/icons/png/256x256.png'),
|
||||
icon_path: join(process.cwd(), '/resources/icons/png/256x256.png'),
|
||||
homepage: 'https://www.usebruno.com/',
|
||||
package_json_dir: join(__dirname, '../..')
|
||||
})
|
||||
|
@ -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') {
|
||||
|
Loading…
Reference in New Issue
Block a user