File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ export class H3Event<
9393 return this . node . res ;
9494 }
9595
96- get body ( ) {
96+ /** @experimental */
97+ get rawBody ( ) {
9798 if ( ! this . _hasBody ) {
9899 return undefined ;
99100 }
@@ -123,7 +124,7 @@ export class H3Event<
123124 duplex : "half" ,
124125 method : this . method ,
125126 headers : this . headers ,
126- body : this . body ,
127+ body : this . rawBody ,
127128 } ) ;
128129 }
129130 return this . _request ;
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export async function proxyRequest(
4040 let duplex : Duplex | undefined ;
4141 if ( PayloadMethods . has ( event . method ) ) {
4242 if ( opts . streamRequest ) {
43- body = event . body ;
43+ body = event . rawBody ;
4444 duplex = "half" ;
4545 } else {
4646 body = await readRawBody ( event , false ) . catch ( ( ) => undefined ) ;
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ describe("Event", () => {
5757 app . use (
5858 "/" ,
5959 eventHandler ( async ( event ) => {
60- const bodyStream = event . body as unknown as NodeJS . ReadableStream ;
60+ const bodyStream = event . rawBody as unknown as NodeJS . ReadableStream ;
6161 let bytes = 0 ;
6262 for await ( const chunk of bodyStream ) {
6363 bytes += chunk . length ;
You can’t perform that action at this time.
0 commit comments