@artilleryio/int-core 2.14.0-99a7df7 → 2.14.0-c475686

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.
Files changed (2) hide show
  1. package/lib/engine_http.js +16 -8
  2. package/package.json +2 -2
@@ -403,15 +403,23 @@ HttpEngine.prototype.step = function step(requestSpec, ee, opts) {
403
403
  requestParams.formData,
404
404
  function (acc, v, k) {
405
405
  let V = template(v, context);
406
- if (V && _.isPlainObject(V) && V.fromFile) {
407
- const absPath = path.resolve(
408
- path.dirname(context.vars.$scenarioFile),
409
- V.fromFile
410
- );
411
- fileUpload = absPath;
412
- V = fs.createReadStream(absPath);
406
+ let options;
407
+ if (V && _.isPlainObject(V)) {
408
+ if (V.contentType) {
409
+ options = { contentType: V.contentType };
410
+ }
411
+ if (V.fromFile) {
412
+ const absPath = path.resolve(
413
+ path.dirname(context.vars.$scenarioFile),
414
+ V.fromFile
415
+ );
416
+ fileUpload = absPath;
417
+ V = fs.createReadStream(absPath);
418
+ } else if (V.value) {
419
+ V = V.value;
420
+ }
413
421
  }
414
- acc.append(k, V);
422
+ acc.append(k, V, options);
415
423
  return acc;
416
424
  },
417
425
  f
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@artilleryio/int-core",
3
- "version": "2.14.0-99a7df7",
3
+ "version": "2.14.0-c475686",
4
4
  "main": "./index.js",
5
5
  "license": "MPL-2.0",
6
6
  "dependencies": {
7
- "@artilleryio/int-commons": "2.10.0-99a7df7",
7
+ "@artilleryio/int-commons": "2.10.0-c475686",
8
8
  "@artilleryio/sketches-js": "^2.1.1",
9
9
  "agentkeepalive": "^4.1.0",
10
10
  "arrivals": "^2.1.2",