{"record":{"id":"9ddd353a144f0620","repo":"deepseek-ai/deepseek-harness","slug":"web-invalid-url","errorCode":"WEB_INVALID_URL","errorMessage":"URL exceeds the maximum length of ${maxUrlLength}","messagePattern":"URL exceeds the maximum length of (.+?)","errorType":"error_code","errorClass":"WebError","httpStatus":null,"severity":"error","filePath":"packages/web/web-fetch-http/src/policy.ts","lineNumber":26,"sourceCode":"\nimport { WebError } from '@deepseek-ai/dsh-web'\n\n/** The body kinds this provider decodes. */\nexport type FetchableKind = 'html' | 'text'\n\n/**\n * Validate a request URL against the basic transport hygiene the provider\n * enforces before any network access: http(s) only, no embedded credentials,\n * bounded length. Returns the parsed `URL`. Throws {@link WebError} otherwise.\n * (SSRF / private-network blocking is deferred — see the package Agent Note.)\n *\n * @param input - the raw URL string from the fetch request.\n * @param maxUrlLength - inclusive upper bound on `input`'s length.\n * @returns the parsed `URL`.\n */\nexport function validateFetchUrl(input: string, maxUrlLength: number): URL {\n  if (input.length > maxUrlLength) {\n    throw new WebError(`URL exceeds the maximum length of ${maxUrlLength}`, 'WEB_INVALID_URL')\n  }\n  let url: URL\n  try {\n    url = new URL(input)\n  } catch (error: unknown) {\n    throw new WebError(`invalid URL: ${input}`, 'WEB_INVALID_URL', { cause: error })\n  }\n  if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n    throw new WebError(`unsupported URL scheme \"${url.protocol}\" (only http and https are allowed)`, 'WEB_INVALID_URL')\n  }\n  if (url.username.length > 0 || url.password.length > 0) {\n    throw new WebError('credentials in URLs are not allowed', 'WEB_BLOCKED_URL')\n  }\n  return url\n}\n\n/**\n * Two URLs are same-origin when scheme, hostname, and port match. A redirect","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/web/web-fetch-http/src/policy.ts#L8-L44","documentation":"Error \"URL exceeds the maximum length of ${maxUrlLength}\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/web/web-fetch-http/src/policy.ts:26 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shorten the URL below the maximum length, or raise maxUrlLength in configuration."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}