deepseek-ai/deepseek-harness · error · WebError
WEB_UNSUPPORTED_CONTENT_TYPE
WEB_UNSUPPORTED_CONTENT_TYPE
Error message
unsupported content type "${contentType ?? 'unknown'}" What it means
Error "unsupported content type "${contentType ?? 'unknown'}"" thrown in deepseek-ai/deepseek-harness.
Source
Thrown at packages/web/web-fetch-http/src/provider.ts:122
try {
return await fetch(url, {
method: 'GET',
redirect: 'manual',
headers: { 'user-agent': this.limits.userAgent, 'accept': 'text/html,application/xhtml+xml,text/*;q=0.9,application/json;q=0.8' },
signal,
})
} catch (error: unknown) {
throw translateAbortOrNetwork(error, signal)
}
}
/** Read, byte-cap, classify, and decode the final response body. */
private async readBody(response: Response, finalUrl: URL, signal: AbortSignal): Promise<WebFetchResult> {
const contentType = response.headers.get('content-type')
const kind = classifyContentType(contentType)
if (kind === undefined) {
await response.body?.cancel()
throw new WebError(`unsupported content type "${contentType ?? 'unknown'}"`, 'WEB_UNSUPPORTED_CONTENT_TYPE')
}
// Resolve the decoder BEFORE reading the body so an unsupported charset
// fails without consuming the stream — but cancel the body on that failure
// so the socket does not leak (matching the unsupported-content-type path).
let decoder: TextDecoder
try {
decoder = decoderForCharset(parseCharset(contentType))
} catch (error: unknown) {
await response.body?.cancel()
throw error
}
const { bytes, truncatedByBytes } = await this.readCapped(response, signal)
const decoded = decoder.decode(bytes)
const truncatedByChars = decoded.length > this.limits.maxBodyChars
const content = truncatedByChars ? decoded.slice(0, this.limits.maxBodyChars) : decoded
const body: WebFetchBody = kind === 'html' ? { kind: 'html', content } : { kind: 'text', content }
View on GitHub (pinned to b150a551b8)
Solutions
- Fetch a resource with a supported content type, or add the content type to the supported list.
When it happens
Trigger: Thrown at packages/web/web-fetch-http/src/provider.ts:122 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24).
Data as JSON: /api/errors/617783fe1f024b95.
Report an issue: GitHub.