mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
support OPTIONS ping to SBCs
This commit is contained in:
@@ -33,8 +33,8 @@ class Requestor {
|
||||
const myPort = u.port ? `:${u.port}` : '';
|
||||
const baseUrl = `${u.protocol}://${u.resource}${myPort}`;
|
||||
|
||||
this.get = bent(baseUrl, 'GET', 'buffer', 200);
|
||||
this.post = bent(baseUrl, 'POST', 'buffer', 200);
|
||||
this.get = bent(baseUrl, 'GET', 'buffer', 200, 201);
|
||||
this.post = bent(baseUrl, 'POST', 'buffer', 200, 201);
|
||||
|
||||
assert(isAbsoluteUrl(this.url));
|
||||
assert(['GET', 'POST'].includes(this.method));
|
||||
@@ -64,7 +64,7 @@ class Requestor {
|
||||
this.logger.debug({hook}, `Requestor:request ${method} ${url}`);
|
||||
const buf = isRelativeUrl(url) ?
|
||||
await this.post(url, params, this.authHeader) :
|
||||
await bent(method, 'buffer', 200)(url, params, basicAuth(username, password));
|
||||
await bent(method, 'buffer', 200, 201)(url, params, basicAuth(username, password));
|
||||
//this.logger.debug({body: }, `Requestor:request ${method} ${url} succeeded`);
|
||||
|
||||
if (buf && buf.toString().length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user