{"record":{"id":"e8872e2a02dd5c1c","repo":"Kong/insomnia","slug":"error-in-response-the-lastredirect-is-not-defined","errorCode":null,"errorMessage":"Error in response: the lastRedirect is not defined","messagePattern":"Error in response: the lastRedirect is not defined","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia/src/plugins/context/network.ts","lineNumber":94,"sourceCode":"            settingRebuildPath: true,\n            settingSendCookies: true,\n            ...originRequest,\n          },\n          finalUrl: originRequest.url,\n          settings,\n          certificates: [],\n          caCertficatePath,\n        });\n        const { headerResults, patch, responseBodyPath } = response;\n        if (patch.error) {\n          throw new Error(patch.error);\n        }\n        if (headerResults.length === 0) {\n          throw new Error('Error in response: no header result is found');\n        }\n        const lastRedirect = headerResults[headerResults.length - 1];\n        if (!lastRedirect) {\n          throw new Error('Error in response: the lastRedirect is not defined');\n        }\n        const bodyResult = await services.helpers.readCurlResponse({\n          bodyPath: responseBodyPath,\n          bodyCompression: patch.bodyCompression,\n        });\n\n        return {\n          code: lastRedirect.code,\n          reason: lastRedirect.reason,\n          headers: lastRedirect.headers,\n          responseTime: patch.elapsedTime,\n          body: bodyResult.body,\n          ok: lastRedirect.code >= 200 && lastRedirect.code < 300,\n          status: lastRedirect.reason || RESPONSE_CODE_REASONS[lastRedirect.code] || 'Unknown',\n          json: () => {\n            try {\n              return JSON.parse(bodyResult.body);\n            } catch (error) {","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia/src/plugins/context/network.ts#L76-L112","documentation":"Error \"Error in response: the lastRedirect is not defined\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia/src/plugins/context/network.ts:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}