Describe the bug
- Node.js version: 22.12.0
- OS & version: macOS 15.1.1
OPTIONS stream request requires body: '' to finish the request successfully.
const str = got.stream('https://www.jsdelivr.com', {
"method": "OPTIONS",
"body": '', // `RequestError: socket hang up` without that parameter.
});
Actual behavior
Either RequestError: socket hang up, or unnecessary body: '' should be passed.
Expected behavior
Should work fine without body: '' since OPTIONS request doesn't have body.
Code to reproduce
const str = got.stream('https://www.jsdelivr.com', {
"method": "OPTIONS",
});
str.on('socket', () => { console.log('socket'); });
str.on('end', () => { console.log('end'); });
str.on('retry', (...args) => { console.log('retry', ...args); });
Checklist
Describe the bug
OPTIONS stream request requires
body: ''to finish the request successfully.Actual behavior
Either
RequestError: socket hang up, or unnecessarybody: ''should be passed.Expected behavior
Should work fine without
body: ''since OPTIONS request doesn't have body.Code to reproduce
Checklist