fixed browser, made payload optional
This commit is contained in:
parent
917f91715a
commit
cde67db271
9 changed files with 10 additions and 12 deletions
|
|
@ -171,10 +171,15 @@ class BrowserSingleton {
|
|||
|
||||
if (proxy) {
|
||||
const [protocol, rest] = proxy.split('://');
|
||||
if (!rest) {
|
||||
throw new Error('Invalid proxy format. Expected protocol://host:port or protocol://user:pass@host:port');
|
||||
}
|
||||
|
||||
const [auth, hostPort] = rest.includes('@') ? rest.split('@') : [null, rest];
|
||||
const [host, port] = hostPort.split(':');
|
||||
const finalHostPort = hostPort || rest;
|
||||
const [host, port] = finalHostPort.split(':');
|
||||
|
||||
contextOptions.proxy = {
|
||||
contextOptions['proxy'] = {
|
||||
server: `${protocol}://${host}:${port}`,
|
||||
username: auth?.split(':')[0] || '',
|
||||
password: auth?.split(':')[1] || '',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue