Fixed rendering potentially unsafe values

This commit is contained in:
Gregory Schier 2016-12-08 10:42:45 -08:00
parent bb0ed87ca7
commit 2e5b28cf67
5 changed files with 10 additions and 10 deletions

View File

@ -153,6 +153,9 @@ export function _actuallySend (renderedRequest, workspace, settings, forceIPv4 =
jar._jar = jarFromCookies(cookieJar.cookies);
config.jar = jar;
// Set the IP family. This fallback behaviour is copied from Curl
config.family = forceIPv4 ? 4 : 6;
config.callback = async (err, networkResponse) => {
if (err) {
const isShittyParseError = err.toString() === 'Error: Parse Error';
@ -216,9 +219,6 @@ export function _actuallySend (renderedRequest, workspace, settings, forceIPv4 =
models.response.create(responsePatch).then(resolve, reject);
};
// Set the IP family. This fallback behaviour is copied from Curl
config.family = forceIPv4 ? 4 : 6;
const requestStartTime = Date.now();
const req = new networkRequest.Request(config);

View File

@ -86,10 +86,7 @@ export function buildRenderContext (ancestors, rootEnvironment, subEnvironment)
// Now we're going to render the renderContext with itself.
// This is to support templating inside environments
const stringifiedEnvironment = JSON.stringify(renderContext);
return JSON.parse(
render(stringifiedEnvironment, renderContext)
)
return recursiveRender(renderContext, renderContext);
}
export function recursiveRender (obj, context) {

View File

@ -505,7 +505,7 @@ function createWindow () {
{
label: "Insomnia Help",
accelerator: "CmdOrCtrl+?",
click: (e) => {
click: () => {
trackEvent('App Menu', 'Help');
shell.openExternal('https://insomnia.rest/documentation');
}

View File

@ -17,7 +17,10 @@ export function init () {
export function migrate (doc) {
// There was a bug on import that would set this to the current workspace ID.
// Let's remove it here so that nothing bad happens.
doc.parentId = null;
if (doc.parentId !== null) {
// Save it to the DB for this one
process.nextTick(() => update(doc, {parentId: null}));
}
return doc;
}

View File

@ -1,7 +1,7 @@
{
"private": true,
"name": "insomnia",
"version": "4.0.5",
"version": "4.0.7",
"productName": "Insomnia",
"longName": "Insomnia REST Client",
"description": "A simple and beautiful REST API client",