{"record":{"id":"5b82bac94e0e2ca3","repo":"Kong/insomnia","slug":"failed-to-fetch-href-response-status-re","errorCode":null,"errorMessage":"Failed to fetch \"${href}\": ${response.status} ${response.statusText}","messagePattern":"Failed to fetch \"(.+?)\": (.+?) (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/insomnia-inso/src/commands/lint-specification.ts","lineNumber":56,"sourceCode":"  const records = await dns.lookup(hostname, { all: true });\n  for (const { address } of records) {\n    if (isPrivateOrLoopbackHost(address)) {\n      throw new Error(`Failed to resolve host. \"${hostname}\" resolves to a private or loopback address.`);\n    }\n  }\n}\n\n// Note: This is duplicated in insomnia's main/lint-process.mjs. Remember to mirror changes there as well.\nconst safeHttpResolver = {\n  async resolve(ref: { href: () => string }): Promise<string> {\n    const href = ref.href();\n    if (!isSafeRefUrl(href)) {\n      throw new Error(`Failed to resolve \"${href}\". Only https URLs to public hosts are allowed.`);\n    }\n    await assertResolvesToPublicHost(new URL(href).hostname.toLowerCase());\n    const response = await fetch(href, { redirect: 'error', signal: AbortSignal.timeout(10_000) });\n    if (!response.ok) {\n      throw new Error(`Failed to fetch \"${href}\": ${response.status} ${response.statusText}`);\n    }\n    return response.text();\n  },\n};\n\nexport const safeRefResolver = new Resolver({\n  resolvers: {\n    http: safeHttpResolver,\n    https: safeHttpResolver,\n  },\n});\n\nexport const getRuleSetFileFromFolderByFilename = async (filePath: string) => {\n  try {\n    const filesInSpecFolder = await fs.promises.readdir(path.dirname(filePath));\n    const rulesetFileName = filesInSpecFolder.find(file => file.startsWith('.spectral'));\n    if (rulesetFileName) {\n      logger.trace(`Loading ruleset from \\`${rulesetFileName}\\``);","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia-inso/src/commands/lint-specification.ts#L38-L74","documentation":"Error \"Failed to fetch \"${href}\": ${response.status} ${response.statusText}\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia-inso/src/commands/lint-specification.ts:56 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"}