forked from retoor/devplacepy
Update
This commit is contained in:
@@ -73,10 +73,17 @@ class CurlResponseStream(httpx.AsyncByteStream):
|
||||
|
||||
|
||||
class CurlTransport(httpx.AsyncBaseTransport):
|
||||
def __init__(self, *, impersonate: str = IMPERSONATE_TARGET, verify: bool = True) -> None:
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
impersonate: str = IMPERSONATE_TARGET,
|
||||
verify: bool = True,
|
||||
proxy: str | None = None,
|
||||
) -> None:
|
||||
self._session = AsyncSession()
|
||||
self._impersonate = impersonate
|
||||
self._verify = verify
|
||||
self._proxy = proxy
|
||||
|
||||
async def handle_async_request(self, request: httpx.Request) -> httpx.Response:
|
||||
headers = {
|
||||
@@ -97,6 +104,7 @@ class CurlTransport(httpx.AsyncBaseTransport):
|
||||
data=body or None,
|
||||
impersonate=self._impersonate,
|
||||
verify=self._verify,
|
||||
proxy=self._proxy,
|
||||
stream=True,
|
||||
allow_redirects=False,
|
||||
timeout=resolve_timeout(request),
|
||||
|
||||
Reference in New Issue
Block a user