{"record":{"id":"617783fe1f024b95","repo":"deepseek-ai/deepseek-harness","slug":"web-unsupported-content-type-617783","errorCode":"WEB_UNSUPPORTED_CONTENT_TYPE","errorMessage":"unsupported content type \"${contentType ?? 'unknown'}\"","messagePattern":"unsupported content type \"(.+?)\"","errorType":"exception","errorClass":"WebError","httpStatus":null,"severity":"error","filePath":"packages/web/web-fetch-http/src/provider.ts","lineNumber":122,"sourceCode":"    try {\n      return await fetch(url, {\n        method: 'GET',\n        redirect: 'manual',\n        headers: { 'user-agent': this.limits.userAgent, 'accept': 'text/html,application/xhtml+xml,text/*;q=0.9,application/json;q=0.8' },\n        signal,\n      })\n    } catch (error: unknown) {\n      throw translateAbortOrNetwork(error, signal)\n    }\n  }\n\n  /** Read, byte-cap, classify, and decode the final response body. */\n  private async readBody(response: Response, finalUrl: URL, signal: AbortSignal): Promise<WebFetchResult> {\n    const contentType = response.headers.get('content-type')\n    const kind = classifyContentType(contentType)\n    if (kind === undefined) {\n      await response.body?.cancel()\n      throw new WebError(`unsupported content type \"${contentType ?? 'unknown'}\"`, 'WEB_UNSUPPORTED_CONTENT_TYPE')\n    }\n\n    // Resolve the decoder BEFORE reading the body so an unsupported charset\n    // fails without consuming the stream — but cancel the body on that failure\n    // so the socket does not leak (matching the unsupported-content-type path).\n    let decoder: TextDecoder\n    try {\n      decoder = decoderForCharset(parseCharset(contentType))\n    } catch (error: unknown) {\n      await response.body?.cancel()\n      throw error\n    }\n    const { bytes, truncatedByBytes } = await this.readCapped(response, signal)\n    const decoded = decoder.decode(bytes)\n    const truncatedByChars = decoded.length > this.limits.maxBodyChars\n    const content = truncatedByChars ? decoded.slice(0, this.limits.maxBodyChars) : decoded\n    const body: WebFetchBody = kind === 'html' ? { kind: 'html', content } : { kind: 'text', content }\n","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/web/web-fetch-http/src/provider.ts#L104-L140","documentation":"Error \"unsupported content type \"${contentType ?? 'unknown'}\"\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/web/web-fetch-http/src/provider.ts:122 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fetch a resource with a supported content type, or add the content type to the supported list."],"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"}