Skip to content

Commit

Permalink
Fix CodeQL errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronilan committed Jun 29, 2024
1 parent 180e08d commit 43cf865
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mock/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ function http_mock() {
const baseHostname = 's3.us-east-1.amazonaws.com';
const basePath = `${os.tmpdir()}/mock`;

nock(new RegExp('^.*' + baseHostname))
nock(new RegExp('^\.*' + baseHostname))
.persist()
.get(() => true) //a function that always returns true is a catch all for nock
.reply(
(uri) => {
const bucket = 'npg-mock-bucket';
const mockDir = uri.indexOf(bucket) === -1 ? `${basePath}/${bucket}` : basePath;
const filepath = path.join(mockDir, uri.replace('%2B', '+'));
const filepath = path.join(mockDir, uri.replace(new RegExp('%2B', 'g'), '+'));

try {
fs.accessSync(filepath, fs.constants.R_OK);
Expand Down

0 comments on commit 43cf865

Please sign in to comment.