{"record":{"id":"55d119e4f83e96a9","repo":"usebruno/bruno","slug":"invalid-url-only-http-and-https-urls-are-allowed","errorCode":null,"errorMessage":"Invalid URL: only http and https URLs are allowed","messagePattern":"Invalid URL: only http and https URLs are allowed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/openapi-sync.js","lineNumber":1702,"sourceCode":"      const { format, brunoConfig, collectionRoot } = loadBrunoConfig(collectionPath);\n\n      // Merge new config into existing entry (allowlist keys only)\n      const allowedKeys = ['sourceUrl', 'groupBy', 'lastSyncDate', 'specHash', 'autoCheck', 'autoCheckInterval'];\n      const sanitizedConfig = {};\n      for (const key of allowedKeys) {\n        if (key in config) {\n          sanitizedConfig[key] = config[key];\n        }\n      }\n\n      // sourceUrl is required — it identifies which entry to create/update\n      if (!sanitizedConfig.sourceUrl) {\n        throw new Error('sourceUrl is required to update openapi sync config');\n      }\n\n      // Validate sourceUrl — reject protocol-based non-http(s) URLs (e.g. ftp://, file://)\n      if (sanitizedConfig.sourceUrl.includes('://') && !isValidHttpUrl(sanitizedConfig.sourceUrl)) {\n        throw new Error('Invalid URL: only http and https URLs are allowed');\n      }\n\n      // Resolve to absolute for consistent internal handling (saveBrunoConfig converts back to relative)\n      sanitizedConfig.sourceUrl = resolveSourceUrl(collectionPath, sanitizedConfig.sourceUrl);\n\n      // Update or create the single openapi entry\n      const existingEntry = brunoConfig.openapi?.[0];\n      if (existingEntry) {\n        brunoConfig.openapi = [{ ...existingEntry, ...sanitizedConfig }];\n      } else {\n        if (!('autoCheck' in sanitizedConfig)) sanitizedConfig.autoCheck = true;\n        if (!('autoCheckInterval' in sanitizedConfig)) sanitizedConfig.autoCheckInterval = 5;\n        brunoConfig.openapi = [sanitizedConfig];\n      }\n\n      // Save updated config\n      await saveBrunoConfig(collectionPath, format, brunoConfig, collectionRoot);\n","sourceCodeStart":1684,"sourceCodeEnd":1720,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/openapi-sync.js#L1684-L1720","documentation":"Error \"Invalid URL: only http and https URLs are allowed\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/ipc/openapi-sync.js:1702 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an http:// or https:// URL for the spec source.","Remove unsupported schemes like file: or ftp:."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}