Skip to content

Commit

Permalink
Merge pull request #853 from telefonicaid/fix/use_default_transport_c…
Browse files Browse the repository at this point in the history
…onfig

Use config.defaultTransport instead of 'HTTP'
  • Loading branch information
fgalan authored Jan 20, 2025
2 parents 7a18916 + c7c7f02 commit e5f0442
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion lib/bindings/HTTPBinding.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/ngsiv2/config-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ config.iota = {
};

config.defaultKey = '1234';
config.defaultTransport = 'MQTT';
config.defaultTransport = 'HTTP';

module.exports = config;

0 comments on commit e5f0442

Please sign in to comment.