Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test app manager: respect ablyGlobals settings re port/tls #1746

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading