anomalyco / anomalyco/opencode

webfetch skips HTML conversion for mixed-case media types

Open
#49,322 0 comments 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Sep 16, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

webfetch skips HTML conversion when the server uses different casing in its media type.

For example, a response with:

Content-Type: Text/HTML; Charset=UTF-8

passes the textual-content check, but format: "markdown" and format: "text" return the raw HTML. The conversion path checks the original header with a case-sensitive includes("text/html").

HTTP media types are case-insensitive. Mixed-case text/html values should behave like lowercase text/html.

Plugins

Built-in webfetch only.

OpenCode version

V2 source at ba753b383f678896eb8df8f243faecc9f4e27c66.

Steps to reproduce
  1. Return <h1>Hello</h1> with Content-Type: Text/HTML; Charset=UTF-8.
  2. Call webfetch with format: "markdown".
  3. Observe raw <h1>Hello</h1> instead of # Hello.
Operating System

macOS arm64.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.