Skip to content

Commit 7bca61c

Browse files
fix Security issues
1 parent a28f8bc commit 7bca61c

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

bin/accessibility-automation/plugin/index.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const path = require("node:path");
22
const { decodeJWTToken } = require("../../helpers/utils");
33
const utils = require('../../helpers/utils');
4-
const https = require('https');
4+
const http = require('http');
55

66
const browserstackAccessibility = (on, config) => {
77
let browser_validation = true;
@@ -26,15 +26,7 @@ const browserstackAccessibility = (on, config) => {
2626
port,
2727
path: `/test-uuid?testIdentifier=${encodeURIComponent(testIdentifier)}`,
2828
method: 'GET',
29-
timeout: 2000,
30-
// Use proper certificate validation for localhost
31-
checkServerIdentity: (host, cert) => {
32-
// Allow localhost connections
33-
if (host === '127.0.0.1' || host === 'localhost') {
34-
return undefined;
35-
}
36-
return new Error('Hostname verification failed');
37-
}
29+
timeout: 2000
3830
};
3931
const httpModule = http;
4032
const req = httpModule.request(options, (res) => {

bin/testObservability/reporter/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Mocha = requireModule('mocha');
1111
// const Runnable = requireModule('mocha/lib/runnable');
1212
const Runnable = require('mocha/lib/runnable'); // need to handle as this isn't present in older mocha versions
1313
const { v4: uuidv4 } = require('uuid');
14-
const https = require('https');
14+
const http = require('http');
1515

1616
const { IPC_EVENTS, TEST_REPORTING_ANALYTICS } = require('../helper/constants');
1717
const { startIPCServer } = require('../plugin/ipcServer');
@@ -236,7 +236,7 @@ class MyReporter {
236236
res.end();
237237
return;
238238
}
239-
const parsedUrl = new URL(req.url, `https://${req.headers.host}`);
239+
const parsedUrl = new URL(req.url, `http://${req.headers.host}`);
240240
const pathname = parsedUrl.pathname;
241241
const query = parsedUrl.searchParams;
242242

0 commit comments

Comments
 (0)