fork of hey-api/openapi-ts because I need some additional things

Clarify comment about FormData Content-Type handling

Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>

+6 -4
+6 -4
packages/openapi-ts/src/plugins/@hey-api/client-ofetch/bundle/client.ts
··· 139 139 opts.signal = (request as any).signal as AbortSignal | undefined; 140 140 141 141 // When body is FormData, remove Content-Type header to avoid boundary mismatch. 142 - // The Request constructor auto-generates a boundary and sets Content-Type, but 143 - // we pass the original FormData to ofetch which will generate its own boundary. 144 - // If we keep the Request's Content-Type, the boundary in the header won't match 145 - // the boundary in the actual request body sent by ofetch. 142 + // Note: We already delete Content-Type in resolveOptions for FormData, but the 143 + // Request constructor (line 175) re-adds it with an auto-generated boundary. 144 + // Since we pass the original FormData (not the Request's body) to ofetch, and 145 + // ofetch will generate its own boundary, we must remove the Request's Content-Type 146 + // to let ofetch set the correct one. Otherwise the boundary in the header won't 147 + // match the boundary in the actual multipart body sent by ofetch. 146 148 if (typeof FormData !== 'undefined' && body instanceof FormData) { 147 149 opts.headers.delete('Content-Type'); 148 150 }