Review follow-ups for the inline video/audio reference decoder:
- decode_data_url now undoes percent escapes and strips whitespace in
64 KiB chunks and stops as soon as the payload must decode to more than
server.media_reference_max_bytes. An oversized request costs memory in
proportion to the limit, not to its own size. Escapes are never split
across chunks.
- Data URL checks lower-case only the scheme instead of copying the whole
URL.
- Tests: the wrapped/percent-escaped payload decodes the same at chunk
sizes that split escapes and line breaks; an oversized payload is refused
after a few chunks; and a request cancelled before its decoding thread
writes the file still leaves no upload once the thread finishes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>