You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using got.post with both body and cache options causes an exception.
Node.js version: 13.6.0
OS & version: Fedora 30
got version: 10.2.2
Actual behavior
GotError: Cannot read property 'on' of undefined
at onError (/usr/src/npm/failures/got-test/node_modules/got/dist/source/request-as-event-emitter.js:137:29)
at EventEmitter.handleRequest (/usr/src/npm/failures/got-test/node_modules/got/dist/source/request-as-event-emitter.js:170:17)
at destroyer (internal/streams/pipeline.js:27:10)
at internal/streams/pipeline.js:79:12
at Array.map (<anonymous>)
at pipeline (internal/streams/pipeline.js:76:28)
at internal/util.js:297:30
at new Promise (<anonymous>)
at pipeline (internal/util.js:296:12)
at EventEmitter.handleRequest (/usr/src/npm/failures/got-test/node_modules/got/dist/source/request-as-event-emitter.js:162:23)
at Object.onceWrapper (events.js:428:26)
at EventEmitter.emit (events.js:321:20) {
name: 'RequestError'
}
Expected behavior
No exception. Unsure if options.cache should do anything in this case or be ignored. For my own use that does not matter as the server I'm really working with never provides cachable responses to POST requests. Really the goal for me is to be able to use a shared "base options" object and not have to censor the cache option when performing posts.
Describe the bug
Using
got.post
with bothbody
andcache
options causes an exception.Actual behavior
Expected behavior
No exception. Unsure if
options.cache
should do anything in this case or be ignored. For my own use that does not matter as the server I'm really working with never provides cachable responses to POST requests. Really the goal for me is to be able to use a shared "base options" object and not have to censor thecache
option when performing posts.Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: