Skip to content

Commit 570b525

Browse files
committed
fix: fix private proxy configuration
1 parent 5ccafbf commit 570b525

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

pydoll/browser/chromium/base.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
DownloadBehavior,
2525
NetworkErrorReason,
2626
PermissionType,
27+
ResourceType,
2728
)
2829
from pydoll.exceptions import BrowserNotRunning, FailedToStartBrowser, NoValidTabFound
29-
from pydoll.protocol.base import Command
30+
from pydoll.protocol.base import Command, Response
3031
from pydoll.protocol.browser.responses import (
3132
GetVersionResponse,
3233
GetVersionResultDict,
@@ -367,7 +368,9 @@ async def callback_wrapper(event):
367368
)
368369

369370
async def enable_fetch_events(
370-
self, handle_auth_requests: bool = False, resource_type: str = ''
371+
self,
372+
handle_auth_requests: bool = False,
373+
resource_type: Optional[ResourceType] = None,
371374
):
372375
"""
373376
Enable network request interception via Fetch domain.
@@ -383,7 +386,10 @@ async def enable_fetch_events(
383386
Paused requests must be continued or they will timeout.
384387
"""
385388
return await self._connection_handler.execute_command(
386-
FetchCommands.enable(handle_auth_requests, resource_type)
389+
FetchCommands.enable(
390+
handle_auth_requests=handle_auth_requests,
391+
resource_type=resource_type,
392+
)
387393
)
388394

389395
async def disable_fetch_events(self):
@@ -444,15 +450,16 @@ async def _continue_request_with_auth_callback(
444450
):
445451
"""Internal callback for proxy authentication."""
446452
request_id = event['params']['requestId']
447-
await self.disable_fetch_events()
448-
return await self._execute_command(
453+
response: Response = await self._execute_command(
449454
FetchCommands.continue_request_with_auth(
450455
request_id,
451456
auth_challenge_response=AuthChallengeResponseValues.PROVIDE_CREDENTIALS,
452457
proxy_username=proxy_username,
453458
proxy_password=proxy_password,
454459
)
455460
)
461+
await self.disable_fetch_events()
462+
return response
456463

457464
async def _verify_browser_running(self):
458465
"""

0 commit comments

Comments
 (0)