diff --git a/index.js b/index.js index fb06cdc..a21f559 100755 --- a/index.js +++ b/index.js @@ -1093,6 +1093,9 @@ class Hydra extends EventEmitter { if (umfmsg.authorization) { options.headers.Authorization = umfmsg.authorization; } + if (umfmsg.timeout) { + options.timeout = umfmsg.timeout; + } options.body = Utils.safeJSONStringify(umfmsg.body); serverRequest.send(Object.assign(options, sendOpts)) .then((res) => { diff --git a/lib/umfmessage.js b/lib/umfmessage.js index f7b39b9..3755ee4 100644 --- a/lib/umfmessage.js +++ b/lib/umfmessage.js @@ -1,7 +1,7 @@ 'use strict'; const uuid = require('uuid'); -const UMF_VERSION = 'UMF/1.4.4'; +const UMF_VERSION = 'UMF/1.4.5'; /** * @name UMFMessage @@ -76,6 +76,9 @@ class UMFMessage { if (this.message['rmid']) { message['rmid'] = this.message['rmid']; } + if (this.message['timeout']) { + message['tmo'] = this.message['timeout']; + } if (this.message['timestamp']) { message['ts'] = this.message['timestamp']; } @@ -144,6 +147,9 @@ function createMessageInstance(message) { if (message.rmid) { proxy.rmid = message.rmid; } + if (message.timeout || message.tmo) { + proxy.timeout = message.timeout || message.tmo; + } proxy.timestamp = message.timestamp || message.ts || proxy.getTimeStamp(); if (message.type || message.typ) { proxy.type = message.type || message.typ; diff --git a/package.json b/package.json index 0f35c77..334c174 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hydra", - "version": "1.3.11", + "version": "1.3.12", "license": "MIT", "author": "Carlos Justiniano", "contributors": [