-
-
Notifications
You must be signed in to change notification settings - Fork 969
Open
Description
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
- I have read the documentation.
- I have tried my code with the latest version of Node.js and Got.
Metadata
Metadata
Assignees
Labels
No labels