File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -597,7 +597,7 @@ export function defaultPathSerializer(pathname, pathParams) {
597597 * @type {import("./index.js").defaultBodySerializer }
598598 */
599599export function defaultBodySerializer ( body , headers ) {
600- if ( body instanceof FormData || typeof body === "string" || body instanceof URLSearchParams || body instanceof Blob ) {
600+ if ( body instanceof FormData ) {
601601 return body ;
602602 }
603603 if ( headers ) {
Original file line number Diff line number Diff line change @@ -213,32 +213,30 @@ describe("request", () => {
213213 } ) ;
214214
215215 test . each ( BODY_ACCEPTING_METHODS ) ( "`''` body (with body serializer) - %s" , async ( method ) => {
216- const body = ''
217216 const bodySerializer = vi . fn ( ( body ) => `Serialized: ${ JSON . stringify ( body ) } ` ) ;
218217 const { bodyUsed, bodyText } = await fireRequestAndGetBodyInformation ( {
219218 bodySerializer,
220219 method,
221220 fetchOptions : {
222- body,
221+ body : "" ,
223222 } ,
224223 } ) ;
225224
226225 expect ( bodyUsed ) . toBe ( true ) ;
227- expect ( bodyText ) . toBe ( ` Serialized: ${ body } ` ) ;
226+ expect ( bodyText ) . toBe ( ' Serialized: ""' ) ;
228227 expect ( bodySerializer ) . toBeCalled ( ) ;
229228 } ) ;
230229
231230 test . each ( BODY_ACCEPTING_METHODS ) ( "`''` body (without body serializer) - %s" , async ( method ) => {
232- const body = ''
233231 const { bodyUsed, bodyText } = await fireRequestAndGetBodyInformation ( {
234232 method,
235233 fetchOptions : {
236- body,
234+ body : "" ,
237235 } ,
238236 } ) ;
239237
240238 expect ( bodyUsed ) . toBe ( true ) ;
241- expect ( bodyText ) . toBe ( body ) ;
239+ expect ( bodyText ) . toBe ( '""' ) ;
242240 } ) ;
243241
244242 test . each ( BODY_ACCEPTING_METHODS ) ( "`0` body (with body serializer) - %s" , async ( method ) => {
You can’t perform that action at this time.
0 commit comments