{"record":{"id":"3c325dd4d7a89677","repo":"different-ai/openwork","slug":"den-base-url-must-be-an-origin-without-a-path-que","errorCode":null,"errorMessage":"DEN_BASE_URL must be an origin without a path, query, or hash.","messagePattern":"DEN_BASE_URL must be an origin without a path, query, or hash\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ee/packages/utils/src/den-urls.ts","lineNumber":33,"sourceCode":"\nconst DEFAULT_PROTOCOL = \"https:\"\n\nfunction readDenBaseUrl(env: DenUrlEnvironment): string {\n  const value = env.DEN_BASE_URL?.trim()\n  if (!value) {\n    throw new Error(\"DEN_BASE_URL must be configured.\")\n  }\n  return value\n}\n\nfunction parseDenBaseUrl(value: string): URL {\n  const candidate = value.includes(\"://\") ? value : `${DEFAULT_PROTOCOL}//${value}`\n  const url = new URL(candidate)\n  if (url.protocol !== \"http:\" && url.protocol !== \"https:\") {\n    throw new Error(\"DEN_BASE_URL must use http or https.\")\n  }\n  if (url.pathname !== \"/\" || url.search || url.hash) {\n    throw new Error(\"DEN_BASE_URL must be an origin without a path, query, or hash.\")\n  }\n  return url\n}\n\nfunction originFromUrl(url: URL): string {\n  return url.origin.replace(/\\/+$/, \"\")\n}\n\nfunction apiUrlFor(baseUrl: URL): URL {\n  const apiUrl = new URL(baseUrl.href)\n  apiUrl.hostname = `api.${baseUrl.hostname}`\n  return apiUrl\n}\n\nfunction joinUrl(baseUrl: string, path: string): string {\n  return `${baseUrl}${path.startsWith(\"/\") ? path : `/${path}`}`\n}\n","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/ee/packages/utils/src/den-urls.ts#L15-L51","documentation":"Error \"DEN_BASE_URL must be an origin without a path, query, or hash.\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at ee/packages/utils/src/den-urls.ts:33 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":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}