Skip to content

Commit

Permalink
Even further fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfies committed Dec 1, 2024
1 parent 3a20643 commit dccd63a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 2 additions & 2 deletions curl_cffi/requests/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ def set_curl_options(

# set extra curl options, must come after impersonate, because it will alter some options
if curl_options:
for k, v in curl_options.items():
c.setopt(k, v)
for option, setting in curl_options.items():
c.setopt(option, setting)

buffer = None
q = None
Expand Down
5 changes: 1 addition & 4 deletions curl_cffi/requests/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@ async def ws_connect(
akamai: Optional[str] = None,
extra_fp: Optional[Union[ExtraFingerprints, ExtraFpDict]] = None,
default_headers: Optional[bool] = None,
default_encoding: Union[str, Callable[[bytes], str]] = "utf-8",
quote: Union[str, Literal[False]] = "",
http_version: Optional[CurlHttpVersion] = None,
interface: Optional[str] = None,
Expand Down Expand Up @@ -802,8 +801,6 @@ async def ws_connect(
akamai: akamai string to impersonate.
extra_fp: extra fingerprints options, in complement to ja3 and akamai strings.
default_headers: whether to set default browser headers.
default_encoding: encoding for decoding response content if charset is not found
in headers. Defaults to "utf-8". Can be set to a callable for automatic detection.
quote: Set characters to be quoted, i.e. percent-encoded. Default safe string
is ``!#$%&'()*+,/:;=?@[]~``. If set to a sting, the character will be removed
from the safe string, thus quoted. If set to False, the url will be kept as is,
Expand Down Expand Up @@ -849,7 +846,7 @@ async def ws_connect(
)
curl.setopt(CurlOpt.CONNECT_ONLY, 2) # https://curl.se/docs/websocket.html

self.loop.run_in_executor(None, curl.perform)
await self.loop.run_in_executor(None, curl.perform)
return AsyncWebSocket(self, curl, autoclose=autoclose)

async def request(
Expand Down

0 comments on commit dccd63a

Please sign in to comment.