summaryrefslogtreecommitdiff
path: root/lib/_http_client.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/_http_client.js')
-rw-r--r--lib/_http_client.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/_http_client.js b/lib/_http_client.js
index 6eb7d34fc5..1efdd0f53b 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -24,19 +24,21 @@
const util = require('util');
const net = require('net');
const url = require('url');
-const HTTPParser = process.binding('http_parser').HTTPParser;
+const { HTTPParser } = process.binding('http_parser');
const assert = require('assert').ok;
-const common = require('_http_common');
-const httpSocketSetup = common.httpSocketSetup;
-const parsers = common.parsers;
-const freeParser = common.freeParser;
-const debug = common.debug;
-const OutgoingMessage = require('_http_outgoing').OutgoingMessage;
+const {
+ _checkIsHttpToken: checkIsHttpToken,
+ debug,
+ freeParser,
+ httpSocketSetup,
+ parsers
+} = require('_http_common');
+const { OutgoingMessage } = require('_http_outgoing');
const Agent = require('_http_agent');
-const Buffer = require('buffer').Buffer;
+const { Buffer } = require('buffer');
const { urlToOptions, searchParamsSymbol } = require('internal/url');
-const outHeadersKey = require('internal/http').outHeadersKey;
-const nextTick = require('internal/process/next_tick').nextTick;
+const { outHeadersKey } = require('internal/http');
+const { nextTick } = require('internal/process/next_tick');
const errors = require('internal/errors');
// The actual list of disallowed characters in regexp form is more like:
@@ -149,7 +151,7 @@ function ClientRequest(options, cb) {
}
if (methodIsString && method) {
- if (!common._checkIsHttpToken(method)) {
+ if (!checkIsHttpToken(method)) {
throw new errors.TypeError('ERR_INVALID_HTTP_TOKEN', 'Method', method);
}
method = this.method = method.toUpperCase();