Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertion error in _http_client.js #26404

Closed
Trott opened this issue Mar 2, 2019 · 3 comments
Closed

assertion error in _http_client.js #26404

Trott opened this issue Mar 2, 2019 · 3 comments
Labels
http Issues or PRs related to the http subsystem.

Comments

@Trott
Copy link
Member

Trott commented Mar 2, 2019

  • Version: v12.0.0-pre (master branch)
  • Platform: macOS Mojave, but probably irrelevant
  • Subsystem: http

This code causes an assertion error in _http_client.js. Not sure if monkey-patching should be prevented or if the assertion should be a throw instead. But obviously it shouldn't be possible to trigger it.

'use strict';

const http = require('http');

const server = http.createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.end('okay');
});

server.listen(1337, '127.0.0.1');

const req = http.request({
  port: 1337,
  host: '127.0.0.1',
  method: 'GET',
});

req.write('');
req.end(() => { delete req.socket.parser; });

@nodejs/http

@Trott Trott added the http Issues or PRs related to the http subsystem. label Mar 2, 2019
@lpinca
Copy link
Member

lpinca commented Mar 3, 2019

I'm not a fan of defensive code. Anyone doing this is explicitly trying to break things.

@lpinca
Copy link
Member

lpinca commented Mar 3, 2019

Possibly related issue: #26351

@jasnell
Copy link
Member

jasnell commented Jun 26, 2020

I know it's been a while but I have to agree with @lpinca's comment. I wouldn't say this is actionable.

@jasnell jasnell closed this as completed Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants