File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
packages/start/src/server Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,9 @@ export async function handleServerFunction(h3Event: H3Event) {
6060 contentType ?. startsWith ( "application/x-www-form-urlencoded" )
6161 ) {
6262 parsed . push ( await event . request . formData ( ) ) ;
63- } else if ( contentType ?. startsWith ( 'text/plain' ) ) {
63+ } else if ( contentType ?. startsWith ( 'application/json' ) ) {
64+ parsed = await event . request . json ( ) as any [ ] ;
65+ } else if ( request . headers . has ( 'x-serialized' ) ) {
6466 parsed = ( await deserializeJSONStream ( event . request . clone ( ) ) ) as any [ ] ;
6567 }
6668 }
Original file line number Diff line number Diff line change 1- // @ts -ignore - seroval exports issue with NodeNext
1+
22import { type Component } from "solid-js" ;
33import {
44 deserializeJSONStream ,
55 deserializeJSStream ,
6- serializeToJSONStream ,
6+ // serializeToJSONStream,
77 serializeToJSONString ,
88} from "./serialization" ;
99
@@ -51,7 +51,11 @@ async function fetchServerFunction(
5151 body : await serializeToJSONString ( args ) ,
5252 // duplex: 'half',
5353 // body: serializeToJSONStream(args),
54- headers : { ...options . headers , "Content-Type" : "text/plain" } ,
54+ headers : {
55+ ...options . headers ,
56+ "x-serialized" : "true" ,
57+ "Content-Type" : "text/plain"
58+ } ,
5559 } ) ) ;
5660
5761 if (
You can’t perform that action at this time.
0 commit comments