botium-core 1.15.3 → 1.15.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/package.json
CHANGED
|
@@ -262,9 +262,8 @@ module.exports = class SimpleRestContainer {
|
|
|
262
262
|
if (requestOptions.body) {
|
|
263
263
|
debug('Request.form and request.body are mutually exclusive')
|
|
264
264
|
}
|
|
265
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
|
265
266
|
requestOptions.body = new URLSearchParams(requestOptions.form).toString()
|
|
266
|
-
// it is set automatically by fetch
|
|
267
|
-
// requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
|
268
267
|
delete requestOptions.form
|
|
269
268
|
}
|
|
270
269
|
|
|
@@ -710,9 +709,9 @@ module.exports = class SimpleRestContainer {
|
|
|
710
709
|
}
|
|
711
710
|
}
|
|
712
711
|
this._addRequestOptions(requestOptions)
|
|
713
|
-
this._fetchify(requestOptions)
|
|
714
712
|
await executeHook(this.caps, this.requestHook, Object.assign({ requestOptions }, this.view))
|
|
715
713
|
this._addRequestCookies(requestOptions)
|
|
714
|
+
this._fetchify(requestOptions)
|
|
716
715
|
|
|
717
716
|
return requestOptions
|
|
718
717
|
}
|
|
@@ -139,8 +139,9 @@ const _assertHook = async (myCaps) => {
|
|
|
139
139
|
const request = await container.pluginInstance._buildRequest(msg)
|
|
140
140
|
|
|
141
141
|
assert.exists(request.body)
|
|
142
|
-
|
|
143
|
-
assert.
|
|
142
|
+
const body = JSON.parse(request.body)
|
|
143
|
+
assert.exists(body.bodyFieldRequestHook)
|
|
144
|
+
assert.equal(body.bodyFieldRequestHook, 1)
|
|
144
145
|
|
|
145
146
|
assert.exists(container.pluginInstance.view)
|
|
146
147
|
assert.exists(container.pluginInstance.view.context)
|
|
@@ -382,9 +383,8 @@ describe('connectors.simplerest', function () {
|
|
|
382
383
|
[Capabilities.SIMPLEREST_RESPONSE_JSONPATH]: ['$.status']
|
|
383
384
|
}
|
|
384
385
|
const scope = nock('https://mock2.com')
|
|
385
|
-
.post('/endpointForm',
|
|
386
|
-
|
|
387
|
-
})
|
|
386
|
+
.post('/endpointForm', 'formparam1=valueparam1%2B-%25')
|
|
387
|
+
.matchHeader('Content-Type', 'application/x-www-form-urlencoded')
|
|
388
388
|
.reply(200, {
|
|
389
389
|
status: 'ok'
|
|
390
390
|
})
|