@seydx/tr064
Advanced tools
Comparing version 0.4.1-6 to 0.4.1-7
{ | ||
"name": "@seydx/tr064", | ||
"version": "0.4.1-6", | ||
"version": "0.4.1-7", | ||
"author": "Nicolai Schmid <hey@schmid.uno>", | ||
@@ -5,0 +5,0 @@ "description": "TR-064 - UPnP/IGD for node.js", |
@@ -16,2 +16,3 @@ var parseString = require('xml2js').parseString; | ||
this.config = config; | ||
this.timeout=config.timeout*1000||5000; | ||
this._parseSCPD(this); | ||
@@ -346,22 +347,21 @@ } | ||
} else { | ||
parseString(body,{explicitArray: false,}, function (err, result) { | ||
parseString(response.body,{explicitArray: false,}, function (err, result) { | ||
if(!err){ | ||
let env = result['s:Envelope']; | ||
if(env['s:Body']){ | ||
let newBody = env['s:Body']; | ||
if(newBody['s:Fault']){ | ||
let fault = newBody['s:Fault']; | ||
let newFault = body['s:Fault']; | ||
error = { | ||
error: error ? error.errno : 'No message', | ||
errorCode: error ? error.errno : 'No code', | ||
tr064: newFault ? newFault.detail.UPnPError.errorDescription : 'No message', | ||
tr064code: newFault ? newFault.detail.UPnPError.errorCode : 'No code', | ||
fault: newFault ? newFault.faultstring : 'No message', | ||
faultcode: newFault ? newFault.faultcode : 'No code', | ||
serviceType: serviceType, | ||
action: action | ||
}; | ||
} | ||
} | ||
let env = result['s:Envelope']; | ||
if(env['s:Body']){ | ||
let newBody = env['s:Body']; | ||
if(newBody['s:Fault']){ | ||
let fault = newBody['s:Fault']; | ||
error = { | ||
error: error ? error.errno : 'No message', | ||
errorCode: error ? error.errno : 'No code', | ||
tr064: fault ? fault.detail.UPnPError.errorDescription : 'No message', | ||
tr064code: fault ? fault.detail.UPnPError.errorCode : 'No code', | ||
fault: fault ? fault.faultstring : 'No message', | ||
faultcode: fault ? fault.faultcode : 'No code', | ||
serviceType: serviceType, | ||
action: action | ||
}; | ||
} | ||
} | ||
} else { | ||
@@ -368,0 +368,0 @@ error = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
222384