File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -66,4 +66,20 @@ describe("server", () => {
6666 . get ( "/some-route" )
6767 . expect ( 200 , "value" ) ;
6868 } ) ;
69+
70+ it ( "allows big post request" , async ( ) => {
71+ let body = "x"
72+ for ( let i = 0 ; i < 20 ; i ++ ) {
73+ body = body + body
74+ }
75+
76+ const app = createApp (
77+ 'addEventListener("fetch", (e) => e.respondWith(e.request.text().then(text => new Response(`${e.request.method}`))))'
78+ ) ;
79+
80+ await supertest ( app )
81+ . post ( "/some-route" )
82+ . send ( body )
83+ . expect ( 200 , 'POST' ) ;
84+ } ) ;
6985} ) ;
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ function createApp(workerContent, opts = {}) {
3232 let workersByOrigin = { } ;
3333 const kvStores = buildKVStores ( new InMemoryKVStore ( ) , opts . kvStores || [ ] ) ;
3434 const app = express ( ) ;
35- app . use ( bodyParser . raw ( { type : "*/*" } ) ) ;
35+ app . use ( bodyParser . raw ( { type : "*/*" , limit : "100GB" } ) ) ;
3636 app . use ( async ( req , res ) => {
3737 try {
3838 const origin = req . headers . host ;
You can’t perform that action at this time.
0 commit comments