Skip to content

Commit 75d1180

Browse files
committed
Fix client-scoped webhooks with curl_cffi
1 parent 8f03c52 commit 75d1180

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

discord/webhook/async_.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ async def request(
149149
headers['Content-Type'] = 'application/json'
150150
to_send = utils._to_json(payload)
151151

152-
if auth_token is not None: # TODO: same as sync.py
153-
headers['Authorization'] = f'{auth_token}'
152+
if auth_token is not None:
153+
headers['Authorization'] = auth_token
154154

155155
if reason is not None:
156156
headers['X-Audit-Log-Reason'] = urlquote(reason)
@@ -1010,7 +1010,7 @@ def partial(
10101010
if client is not MISSING:
10111011
state = client._connection
10121012
if session is MISSING:
1013-
session = client.http._HTTPClient__session # type: ignore
1013+
session = client.http._HTTPClient__asession # type: ignore
10141014

10151015
if session is MISSING:
10161016
raise TypeError('session or client must be given')
@@ -1049,7 +1049,7 @@ def from_url(
10491049
10501050
.. versionadded:: 2.0
10511051
user_token: Optional[:class:`str`]
1052-
The bot authentication token for authenticated requests
1052+
The authentication token for authenticated requests
10531053
involving the webhook.
10541054
10551055
.. versionadded:: 2.0

discord/webhook/sync.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ def request(
134134
self._locks[bucket] = lock = threading.Lock()
135135

136136
if payload is not None:
137-
headers['Content-Type'] = 'application/json; charset=utf-8'
137+
headers['Content-Type'] = 'application/json'
138138
to_send = utils._to_json(payload).encode('utf-8')
139139

140-
if auth_token is not None: # TODO: is this possible with users?
141-
headers['Authorization'] = f'{auth_token}'
140+
if auth_token is not None:
141+
headers['Authorization'] = auth_token
142142

143143
if reason is not None:
144144
headers['X-Audit-Log-Reason'] = urlquote(reason)
@@ -669,7 +669,7 @@ def from_url(cls, url: str, *, session: Session = MISSING, user_token: Optional[
669669
will not close it. If not given, the ``requests``
670670
auto session creation functions are used instead.
671671
user_token: Optional[:class:`str`]
672-
The bot authentication token for authenticated requests
672+
The authentication token for authenticated requests
673673
involving the webhook.
674674
675675
Raises

0 commit comments

Comments
 (0)