{"record":{"id":"7c27ed34763af96b","repo":"usebruno/bruno","slug":"invalid-request-url","errorCode":null,"errorMessage":"invalid request url","messagePattern":"invalid request url","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-common/src/generate-code/har/index.ts","lineNumber":649,"sourceCode":"  // each one for the path-param value (raw or encoded per the flag).\n  const encodeFlag = working.settings?.encodeUrl === true;\n  const { url: urlWithPlaceholders, restore: restorePathParams } = hashPathParamPositions(urlForPipeline, working.pathParams);\n\n  // Step 4 — Apply `encodeUrl()` to the URL with placeholders. Placeholders\n  // are alphanumeric+dash, so `encodeURIComponent` (used per path segment\n  // inside `encodeUrl`) leaves them untouched. The rest of the path and\n  // query are encoded per the existing content-blind contract (PR #5507).\n  const encodedUrlWithPlaceholders = encodeUrl(urlWithPlaceholders);\n\n  // Step 5 — Restore placeholders. `rawUrl` always uses raw values (for the\n  // toggle-OFF display swap upstream). `encodedUrl` uses single-encoded\n  // values when toggle is ON, raw when OFF.\n  const rawUrl = restorePathParams(urlWithPlaceholders, { encode: false });\n  const encodedUrl = restorePathParams(encodedUrlWithPlaceholders, { encode: encodeFlag });\n\n  // Sanity gate. Stays here so HAR consumers see exactly what we'd send.\n  if (!looksLikeUrl(encodedUrl)) {\n    throw new Error('invalid request url');\n  }\n\n  // Step 5 — Auth → headers. Append to request headers. Request-signing auth (EdgeGrid) must\n  // sign the same `encodedUrl` the snippet transmits, or the signature won't cover the sent bytes.\n  const authHeaders = await authToHeaders(working.auth, variables, input.oauth2Credentials, input.collectionUid, {\n    method: working.method || 'GET',\n    url: encodedUrl,\n    headers: working.headers,\n    bodyText: buildPostData(working.body)?.text\n  });\n  const allHeaders = mergeAndDedupeHeaders(working.headers, authHeaders);\n\n  // Step 6 — Finalize headers (filter enabled, lowercase, default content-type).\n  const harHeaders = finalizeHeaders(working, allHeaders);\n\n  // Step 7 — Query string array. HAR's queryString is the single source of\n  // truth for what HTTPSnippet renders into the URL slot. The URL itself\n  // (next step) has its query stripped to avoid the legacy-polyfill merge bug.","sourceCodeStart":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-common/src/generate-code/har/index.ts#L631-L667","documentation":"Error \"invalid request url\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-common/src/generate-code/har/index.ts:649 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the request URL is a valid absolute URL including protocol (http/https).","Fix variable substitutions that produced an empty or malformed URL."],"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"}