diff options
-rw-r--r-- | packages/astro/src/transitions/router.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/astro/src/transitions/router.ts b/packages/astro/src/transitions/router.ts index 5dc327cf4..adc6bef16 100644 --- a/packages/astro/src/transitions/router.ts +++ b/packages/astro/src/transitions/router.ts @@ -397,7 +397,10 @@ async function transition( // // Note: getNamedItem can return null in real life, even if TypeScript doesn't think so, hence // the ?. - init.body = (from !== undefined && Reflect.get(HTMLFormElement.prototype, "attributes", form).getNamedItem('enctype')?.value === 'application/x-www-form-urlencoded') + init.body = + from !== undefined && + Reflect.get(HTMLFormElement.prototype, 'attributes', form).getNamedItem('enctype') + ?.value === 'application/x-www-form-urlencoded' ? new URLSearchParams(preparationEvent.formData as any) : preparationEvent.formData; } |