mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 17:01:08 +00:00

PR-URL: https://github.com/nodejs/node/pull/14863 Refs: https://github.com/nodejs/node/pull/14781 Refs: https://tools.ietf.org/html/rfc2606#section-2 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
17 lines
466 B
JavaScript
17 lines
466 B
JavaScript
'use strict';
|
|
const assert = require('assert');
|
|
const http = require('http');
|
|
const common = require('../common');
|
|
|
|
// Invalid hostname as per https://tools.ietf.org/html/rfc2606#section-2
|
|
const host = 'this.hostname.is.invalid';
|
|
const req = http.get({ host });
|
|
const err = new Error('mock unexpected code error');
|
|
req.on('error', common.mustCall(() => {
|
|
throw err;
|
|
}));
|
|
|
|
process.on('uncaughtException', common.mustCall((e) => {
|
|
assert.strictEqual(e, err);
|
|
}));
|