mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-05 08:05:12 +00:00
Multipart image uploads were read through io.LimitReader(part, 20MB), so any image larger than 20MB was silently cut short. The OAuth path (and the Grok media path) then base64-encoded the truncated bytes and sent them upstream, which answered 400 invalid_image_file. The API key path forwards the raw multipart body and was not affected, so the same request worked or failed depending on which account served it. - Raise the per-part limit to 50MB, OpenAI's documented per-image limit for GPT image edits, and return 400 when a part exceeds it. - Read Grok media parts whole; the body is already bounded by the gateway request body limit. - Log each upload's content type and size on the images routing line.