|
24 | 24 | const util = require('util'); |
25 | 25 | const net = require('net'); |
26 | 26 | const url = require('url'); |
27 | | -const HTTPParser = process.binding('http_parser').HTTPParser; |
| 27 | +const { HTTPParser } = process.binding('http_parser'); |
28 | 28 | const assert = require('assert').ok; |
29 | | -const common = require('_http_common'); |
30 | | -const httpSocketSetup = common.httpSocketSetup; |
31 | | -const parsers = common.parsers; |
32 | | -const freeParser = common.freeParser; |
33 | | -const debug = common.debug; |
34 | | -const OutgoingMessage = require('_http_outgoing').OutgoingMessage; |
| 29 | +const { |
| 30 | + _checkIsHttpToken: checkIsHttpToken, |
| 31 | + debug, |
| 32 | + freeParser, |
| 33 | + httpSocketSetup, |
| 34 | + parsers |
| 35 | +} = require('_http_common'); |
| 36 | +const { OutgoingMessage } = require('_http_outgoing'); |
35 | 37 | const Agent = require('_http_agent'); |
36 | | -const Buffer = require('buffer').Buffer; |
| 38 | +const { Buffer } = require('buffer'); |
37 | 39 | const { urlToOptions, searchParamsSymbol } = require('internal/url'); |
38 | | -const outHeadersKey = require('internal/http').outHeadersKey; |
39 | | -const nextTick = require('internal/process/next_tick').nextTick; |
| 40 | +const { outHeadersKey } = require('internal/http'); |
| 41 | +const { nextTick } = require('internal/process/next_tick'); |
40 | 42 | const errors = require('internal/errors'); |
41 | 43 |
|
42 | 44 | // The actual list of disallowed characters in regexp form is more like: |
@@ -149,7 +151,7 @@ function ClientRequest(options, cb) { |
149 | 151 | } |
150 | 152 |
|
151 | 153 | if (methodIsString && method) { |
152 | | - if (!common._checkIsHttpToken(method)) { |
| 154 | + if (!checkIsHttpToken(method)) { |
153 | 155 | throw new errors.TypeError('ERR_INVALID_HTTP_TOKEN', 'Method', method); |
154 | 156 | } |
155 | 157 | method = this.method = method.toUpperCase(); |
|
0 commit comments