refactor: protocol regex matches axios

Since axios is used for requests, it makes sense to match the protocol parsing
with their code at
https://github.com/axios/axios/blob/main/lib/helpers/parseProtocol.js

Closes: #1152

Signed-off-by: Graham White <graham_alton@hotmail.com>
This commit is contained in:
Graham White 2023-12-05 17:22:56 +00:00
parent dc39538d02
commit 98b45a2fd4
2 changed files with 2 additions and 2 deletions

View File

@ -17,7 +17,7 @@ const { SocksProxyAgent } = require('socks-proxy-agent');
const { makeAxiosInstance } = require('../utils/axios-instance'); const { makeAxiosInstance } = require('../utils/axios-instance');
const { shouldUseProxy, PatchedHttpsProxyAgent } = require('../utils/proxy-util'); const { shouldUseProxy, PatchedHttpsProxyAgent } = require('../utils/proxy-util');
const protocolRegex = /([a-zA-Z]{2,20}:\/\/)(.*)/; const protocolRegex = /^([-+\w]{1,25})(:?\/\/|:)/;
const runSingleRequest = async function ( const runSingleRequest = async function (
filename, filename,

View File

@ -72,7 +72,7 @@ const getEnvVars = (environment = {}) => {
}; };
}; };
const protocolRegex = /([a-zA-Z]{2,20}:\/\/)(.*)/; const protocolRegex = /^([-+\w]{1,25})(:?\/\/|:)/;
const configureRequest = async ( const configureRequest = async (
collectionUid, collectionUid,