node/test/parallel/test-http-request-invalid-method-error.js
Weijia Wang 11a2ca29ba
errors: migrate _http_outgoing
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>
2017-08-14 17:19:19 -04:00

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"]'
})
);