koajs / bodyparser

Koa body parsing middleware
MIT License
1.31k stars 118 forks source link

Prevent opts singleton being passed into co-body #124

Closed brendanmoore closed 5 years ago

brendanmoore commented 5 years ago

co-body will set opts.length if the header content-length is present in the request. If any subsequent requests follow that dont have content-length (i.e. chunked) the previous value is used, this will trigger a content length mismatch error. Passing a clean opts object will prevent this

brendanmoore commented 5 years ago

I came here from a bug in version 3.2.0, co-body actually clones its options since v4 this PR is not necessary