mirror of
https://github.com/nodejs/node.git
synced 2025-05-04 15:02:25 +00:00

PR-URL: https://github.com/nodejs/node/pull/14735 Refs: https://github.com/nodejs/node/issues/11273 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
14 lines
320 B
JavaScript
14 lines
320 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const http = require('http');
|
|
|
|
assert.throws(
|
|
() => http.request({ method: '\0' }),
|
|
common.expectsError({
|
|
code: 'ERR_INVALID_HTTP_TOKEN',
|
|
type: TypeError,
|
|
message: 'Method must be a valid HTTP token ["\u0000"]'
|
|
})
|
|
);
|