PR-URL: https://github.com/nodejs/node/pull/14423 Refs: https://github.com/nodejs/node/issues/11273 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
14 lines
309 B
JavaScript
14 lines
309 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'
|
|
})
|
|
);
|