Description
Text attachments using an uppercase or mixed-case base64 flag are not decoded in the session prompt path. The shared data-URL helper checks for the exact lowercase substring ;base64; when it receives data:text/plain;BASE64,SGVsbG8=, it falls through to percent-decoding and returns the literal text SGVsbG8= instead of Hello.
The Fetch Standard's data-URL processor matches the base64 flag ASCII case-insensitively. The helper should parse semicolon-delimited metadata and recognize an exact base64 token without regard to casing.
Reference: https://fetch.spec.whatwg.org/#data-url-processor
This is distinct from #47538, which concerns uppercase DATA: schemes during V2 media normalization. This report concerns the BASE64 flag in server-side text attachment decoding.
Plugins
N/A
OpenCode version
N/A (reproduced in the shared data-URL helper)
Steps to reproduce
- Evaluate
decodeDataUrl("data:text/plain;BASE64,SGVsbG8=").
- Observe that it returns
SGVsbG8=.
- Repeat with the lowercase marker
data:text/plain;base64,SGVsbG8= and observe that it returns Hello.
Expected behavior: both casing variants should return Hello.
Screenshot and/or share link
Not provided; the helper call above is the deterministic reproduction.
Operating System
All
Terminal
All
Description
Text attachments using an uppercase or mixed-case
base64flag are not decoded in the session prompt path. The shared data-URL helper checks for the exact lowercase substring;base64; when it receivesdata:text/plain;BASE64,SGVsbG8=, it falls through to percent-decoding and returns the literal textSGVsbG8=instead ofHello.The Fetch Standard's data-URL processor matches the
base64flag ASCII case-insensitively. The helper should parse semicolon-delimited metadata and recognize an exactbase64token without regard to casing.Reference: https://fetch.spec.whatwg.org/#data-url-processor
This is distinct from #47538, which concerns uppercase
DATA:schemes during V2 media normalization. This report concerns theBASE64flag in server-side text attachment decoding.Plugins
N/A
OpenCode version
N/A (reproduced in the shared data-URL helper)
Steps to reproduce
decodeDataUrl("data:text/plain;BASE64,SGVsbG8=").SGVsbG8=.data:text/plain;base64,SGVsbG8=and observe that it returnsHello.Expected behavior: both casing variants should return
Hello.Screenshot and/or share link
Not provided; the helper call above is the deterministic reproduction.
Operating System
All
Terminal
All