diff --git a/docs/data-structures.md b/docs/data-structures.md index bc42a94b3..2feafa775 100644 --- a/docs/data-structures.md +++ b/docs/data-structures.md @@ -27,6 +27,7 @@ Transaction object is passed as a first argument to [hook functions](hooks.md) a - headers (object) - keys are HTTP header names, values are HTTP header contents - uri: `/message` (string) - request URI as it was written in API description - method: `POST` (string) + - encoding: `utf8` (object) - response encoding - expected (object) - the HTTP response Dredd expects to get from the tested server - statusCode: `200` (string) - headers (object) - keys are HTTP header names, values are HTTP header contents diff --git a/package.json b/package.json index 9e7f59e45..0b72fcc3b 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "pretest": "npm run build", "test": "mocha \"test/**/*-test.coffee\"", "test:coverage": "scripts/coverage.sh", - "prepublish": "npm run build", + "prepare": "npm run build", + "prepublish": "check-node-version --npm \">=4\" || npm run prepare", "coveralls": "scripts/coveralls.sh", "semantic-release": "scripts/semantic-release.sh" }, @@ -55,6 +56,7 @@ }, "devDependencies": { "body-parser": "^1.17.1", + "check-node-version": "^2.1.0", "coffee-coverage": "^2.0.1", "coffeelint": "^1.15.7", "conventional-changelog-lint": "^1.1.9", diff --git a/src/transaction-runner.coffee b/src/transaction-runner.coffee index 05f9f9170..b5aecaaa0 100644 --- a/src/transaction-runner.coffee +++ b/src/transaction-runner.coffee @@ -456,6 +456,7 @@ class TransactionRunner options.method = transaction.request.method options.headers = transaction.request.headers options.body = transaction.request.body + options.encoding = transaction.request.encoding options.proxy = false options.followRedirect = false return options