From 267cbcab472fb2488cfc2c44d41aeb413de55459 Mon Sep 17 00:00:00 2001 From: Amit Dhara Date: Tue, 18 Mar 2025 15:05:09 -0500 Subject: [PATCH] Update for insomnia v.11 applying change based on update of insomnia v 11 --- main.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 4b275c9..4d87b0f 100644 --- a/main.js +++ b/main.js @@ -1,12 +1,13 @@ var jp = require("jsonpath"); module.exports.responseHooks = [ - (context) => { + async (context) => { const jsonPath = context.request.getHeader("INSOMNIA-RESPONSE-JSON-PARSE"); let errors = 0; if (jsonPath) { let response = {}; try { - response = JSON.parse(context.response.getBody().toString()); + //response = JSON.parse(context.response.getBody().toString()); + response = JSON.parse((await context.response.getBody()).toString()); } catch (error) { console.error("Error parsing response body", error); return;