File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ export function createAppClient<TApp extends App>(
103103 inputs . body == null ? undefined : smartSerialize ( inputs . body ) ;
104104 if ( body ) {
105105 init . body = body . serialized ;
106- init . headers [ "Content-Type" ] = body . contentType ;
106+ if ( body . contentType ) init . headers [ "Content-Type" ] = body . contentType ;
107107 }
108108
109109 try {
Original file line number Diff line number Diff line change 11export function smartSerialize ( value : unknown ) :
22 | {
3- contentType : string ;
3+ contentType : string | undefined ;
44 serialized : BodyInit ;
55 }
66 | undefined {
77 if ( value == null ) return undefined ;
88
99 if ( value instanceof FormData ) {
1010 return {
11- contentType : "multipart/form-data" ,
11+ contentType : undefined , // Let fetch set the content type with a boundary
1212 serialized : value ,
1313 } ;
1414 }
You can’t perform that action at this time.
0 commit comments