anomalyco / anomalyco/opencode
webfetch skips HTML conversion for mixed-case media types
Open
@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
- Return
<h1>Hello</h1>withContent-Type: Text/HTML; Charset=UTF-8. - Call
webfetchwithformat: "markdown". - Observe raw
<h1>Hello</h1>instead of# Hello.
Operating System
macOS arm64.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.