Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.
Description
- Version: 14.15.2
- Platform: any
- Subsystem: any
What steps will reproduce the bug?
While trying to create a cloned version of an http request object, prototype properties/methods such as headers and get get lost.
constassert=require('assert');consthttp=require('http');constserver=http.createServer((req,res)=>{constdummyReq={ ...req};res.writeHead(200,{'Content-Type': 'text/plain'});res.end('ok');assert.deepStrictEqual(req.headers,dummyReq.headers);}).listen();server.on('listening',()=>{http.get(`http://localhost:${server.address().port}`);});What is the expected behavior?
I honestly don't know if the behavior from 14.15.1 or from 14.15.2 is expected.
Behavior until 14.15.1: dummyReq.headers is not undefined.
What do you see instead?
Output in 14.15.2: dummyReq.headers is undefined.
Additional info
The same happens while using Object.assign
devoto13, ionTea, timbru31, ovlad, RikoDEV and 2 more
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.