@artilleryio/int-core 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/engine_http.js +17 -14
- package/package.json +6 -6
package/lib/engine_http.js
CHANGED
|
@@ -399,6 +399,20 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
|
|
|
399
399
|
);
|
|
400
400
|
requestParams.headers = templatedHeaders;
|
|
401
401
|
|
|
402
|
+
// We compute the url here so that the cookies are set properly afterwards
|
|
403
|
+
let url = maybePrependBase(
|
|
404
|
+
template(requestParams.uri || requestParams.url, context),
|
|
405
|
+
config
|
|
406
|
+
);
|
|
407
|
+
|
|
408
|
+
if (requestParams.uri) {
|
|
409
|
+
// If a hook function sets requestParams.uri to something, request.js
|
|
410
|
+
// will pick that over .url, so we need to delete it.
|
|
411
|
+
delete requestParams.uri;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
requestParams.url = url;
|
|
415
|
+
|
|
402
416
|
if (
|
|
403
417
|
typeof requestParams.cookie === 'object' ||
|
|
404
418
|
typeof context._defaultCookie === 'object'
|
|
@@ -423,19 +437,6 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
|
|
|
423
437
|
delete requestParams.auth;
|
|
424
438
|
}
|
|
425
439
|
|
|
426
|
-
let url = maybePrependBase(
|
|
427
|
-
template(requestParams.uri || requestParams.url, context),
|
|
428
|
-
config
|
|
429
|
-
);
|
|
430
|
-
|
|
431
|
-
if (requestParams.uri) {
|
|
432
|
-
// If a hook function sets requestParams.uri to something, request.js
|
|
433
|
-
// will pick that over .url, so we need to delete it.
|
|
434
|
-
delete requestParams.uri;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
requestParams.url = url;
|
|
438
|
-
|
|
439
440
|
// TODO: Bypass proxy if "proxy: false" is set
|
|
440
441
|
requestParams.agent = {
|
|
441
442
|
http: context._httpAgent,
|
|
@@ -494,7 +495,7 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
|
|
|
494
495
|
requestInfo.qs = qs.encode(
|
|
495
496
|
Object.assign(
|
|
496
497
|
qs.parse(urlparse(requestParams.url).query),
|
|
497
|
-
requestParams.qs
|
|
498
|
+
template(requestParams.qs, context)
|
|
498
499
|
)
|
|
499
500
|
);
|
|
500
501
|
}
|
|
@@ -751,6 +752,8 @@ HttpEngine.prototype._handleResponse = function (
|
|
|
751
752
|
res.on('data', (d) => {
|
|
752
753
|
body += d;
|
|
753
754
|
});
|
|
755
|
+
} else {
|
|
756
|
+
res.on('data', () => {});
|
|
754
757
|
}
|
|
755
758
|
|
|
756
759
|
res.on('end', () => {
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artilleryio/int-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@artilleryio/int-commons": "latest",
|
|
7
7
|
"@artilleryio/sketches-js": "^1.0.4",
|
|
8
|
-
"@hapi/basic": "^6.0.0",
|
|
9
8
|
"agentkeepalive": "^4.1.0",
|
|
10
9
|
"arrivals": "^2.1.2",
|
|
11
10
|
"async": "^2.6.4",
|
|
@@ -19,7 +18,6 @@
|
|
|
19
18
|
"driftless": "^2.0.3",
|
|
20
19
|
"esprima": "^4.0.0",
|
|
21
20
|
"eventemitter3": "^4.0.4",
|
|
22
|
-
"express": "^4.16.3",
|
|
23
21
|
"fast-deep-equal": "^3.1.3",
|
|
24
22
|
"filtrex": "^0.5.4",
|
|
25
23
|
"form-data": "^3.0.0",
|
|
@@ -27,12 +25,10 @@
|
|
|
27
25
|
"hpagent": "^0.1.1",
|
|
28
26
|
"https-proxy-agent": "^5.0.0",
|
|
29
27
|
"lodash": "^4.17.19",
|
|
30
|
-
"nock": "^11.8.2",
|
|
31
28
|
"proxy": "^1.0.2",
|
|
32
29
|
"socket.io": "^3.1.2",
|
|
33
30
|
"socket.io-client": "^4.5.1",
|
|
34
31
|
"socketio-wildcard": "^2.0.0",
|
|
35
|
-
"tap": "^15.2.3",
|
|
36
32
|
"tough-cookie": "^4.0.0",
|
|
37
33
|
"try-require": "^1.2.1",
|
|
38
34
|
"uuid": "^8.0.0",
|
|
@@ -44,8 +40,12 @@
|
|
|
44
40
|
"test": "tap --no-coverage --timeout=300 test/core/unit/*.test.js && bash test/core/run.sh"
|
|
45
41
|
},
|
|
46
42
|
"devDependencies": {
|
|
43
|
+
"@hapi/basic": "^6.0.0",
|
|
47
44
|
"@hapi/hapi": "^20.1.3",
|
|
45
|
+
"express": "^4.16.3",
|
|
46
|
+
"nock": "^11.8.2",
|
|
48
47
|
"rewiremock": "^3.14.3",
|
|
49
|
-
"sinon": "^4.5.0"
|
|
48
|
+
"sinon": "^4.5.0",
|
|
49
|
+
"tap": "15.3.2"
|
|
50
50
|
}
|
|
51
51
|
}
|