mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-06 00:05:30 +00:00
OAuth passthrough forces stream=true for the ChatGPT internal API and then overwrote reqStream from the rewritten body, so clients sending stream=false received the raw upstream SSE stream. Keep the client's original stream flag (compact requests stay non-streaming) so the non-streaming branch aggregates SSE into a single Responses object. Also set Content-Type explicitly when the SSE-to-JSON handlers write the aggregated body: the upstream text/event-stream header was already copied into the response and gin's c.Data does not override an existing Content-Type. Applies to both passthrough and non-passthrough paths. Fixes #7978