Changes the default router.cors() to return null as body to prevent wrangler throwing error about non-null response body on every option request:
Constructing a Response with a null body status (204) and a non-null, zero-length body. This is technically incorrect, and we recommend you update your code to explicitly pass in a null body, e.g. new Response(null, { status: 204, ... }). (We continue to allow the zero-length body behavior because it was previously the only way to construct a Response with a null body status. This behavior may change in the future.)
Changes the default router.cors() to return null as body to prevent wrangler throwing error about non-null response body on every option request:
Constructing a Response with a null body status (204) and a non-null, zero-length body. This is technically incorrect, and we recommend you update your code to explicitly pass in a
null
body, e.g.new Response(null, { status: 204, ... })
. (We continue to allow the zero-length body behavior because it was previously the only way to construct a Response with a null body status. This behavior may change in the future.)