mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
added initial support for REST-initiated outdials
This commit is contained in:
@@ -12,7 +12,9 @@ function retrieveUrl(logger, url, method, auth, obj) {
|
||||
return new Promise((resolve, reject) => {
|
||||
request(opts, (err, response, body) => {
|
||||
if (err) throw err;
|
||||
if (body) logger.debug({body}, 'retrieveUrl: customer returned an application');
|
||||
if (response.statusCode === 401) return reject(new Error('HTTP request failed: Unauthorized'));
|
||||
else if (response.statusCode !== 200) return reject(new Error(`HTTP request failed: ${response.statusCode}`));
|
||||
if (body) logger.debug({body}, 'retrieveUrl: ${method} ${url} returned an application');
|
||||
resolve(body);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user