Skip to content

Commit

Permalink
Test app manager: respect ablyGlobals settings re port/tls
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonWoolf committed Apr 17, 2024
1 parent 60faa30 commit dfc9c76
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/common/modules/testapp_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
/* testapp module is responsible for setting up and tearing down apps in the test environment */
define(['globals', 'ably'], function (ablyGlobals, ably) {
var restHost = ablyGlobals.restHost || prefixDomainWithEnvironment('rest.ably.io', ablyGlobals.environment),
tlsPort = ablyGlobals.tlsPort;
port = ablyGlobals.tls ? ablyGlobals.tlsPort : ablyGlobals.port,
scheme = ablyGlobals.tls ? 'https' : 'http';

var isBrowser = typeof window === 'object',
isNativescript = typeof global === 'object' && global.isNativescript,
Expand Down Expand Up @@ -132,10 +133,10 @@ define(['globals', 'ably'], function (ablyGlobals, ably) {
var postData = JSON.stringify(testData.post_apps);
var postOptions = {
host: restHost,
port: tlsPort,
port,
path: '/apps',
method: 'POST',
scheme: 'https',
scheme,
headers: { Accept: 'application/json', 'Content-Type': 'application/json', 'Content-Length': postData.length },
body: postData,
};
Expand Down Expand Up @@ -171,10 +172,10 @@ define(['globals', 'ably'], function (ablyGlobals, ably) {

var postOptions = {
host: restHost,
port: tlsPort,
port,
path: '/stats',
method: 'POST',
scheme: 'https',
scheme,
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Expand All @@ -200,10 +201,10 @@ define(['globals', 'ably'], function (ablyGlobals, ably) {

var delOptions = {
host: restHost,
port: tlsPort,
port,
method: 'DELETE',
path: '/apps/' + app.appId,
scheme: 'https',
scheme,
headers: { Authorization: 'Basic ' + authHeader },
};

Expand Down

0 comments on commit dfc9c76

Please sign in to comment.