diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index b78a4a263..6efdb0016 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,2 +1,3 @@ +- Fix: use config.defaultTransport (from config.js or IOTA_DEFAULT_TRANSPORT env var) instead of magic 'HTTP' at provision device - Add: X-Processing-Time response header with processing time (in milliseconds) expended by current HTTP measure (iotagent-node-lib#1650) - Add: print also IOTA_CONFIG_RETRIEVAL, IOTA_DEFAULT_KEY, IOTA_DEFAULT_TRANSPORT env var values at iotagent startup diff --git a/lib/bindings/HTTPBinding.js b/lib/bindings/HTTPBinding.js index bfb64b4ed..6ac7b6ffa 100644 --- a/lib/bindings/HTTPBinding.js +++ b/lib/bindings/HTTPBinding.js @@ -506,7 +506,7 @@ function handleError(error, req, res, next) { function setPollingAndDefaultTransport(device, group, callback) { config.getLogger().debug(context, 'httpbinding.setPollingAndDefaultTransport device %j group %j', device, group); if (!device.transport) { - device.transport = group && group.transport ? group.transport : 'HTTP'; + device.transport = group && group.transport ? group.transport : config.getConfig().defaultTransport; } if (device.transport === 'HTTP') { diff --git a/test/unit/ngsiv2/config-test.js b/test/unit/ngsiv2/config-test.js index 3289133d3..62b1985df 100644 --- a/test/unit/ngsiv2/config-test.js +++ b/test/unit/ngsiv2/config-test.js @@ -69,6 +69,6 @@ config.iota = { }; config.defaultKey = '1234'; -config.defaultTransport = 'MQTT'; +config.defaultTransport = 'HTTP'; module.exports = config;