projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fa73d70
)
Update the User-Agent header based on AsyncStream.user_agent
author
Harmon
<Harmon758@gmail.com>
Wed, 18 May 2022 14:03:36 +0000
(09:03 -0500)
committer
Harmon
<Harmon758@gmail.com>
Wed, 18 May 2022 14:04:42 +0000
(09:04 -0500)
Even if AsyncStream.session is already initialized/set
tweepy/asynchronous/streaming.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/asynchronous/streaming.py
b/tweepy/asynchronous/streaming.py
index 1932a86cfafaf13ed04cb6bda4448adab90fa74c..3bf172359cd6199ba15f4940e3d353f0c2d7096b 100644
(file)
--- a/
tweepy/asynchronous/streaming.py
+++ b/
tweepy/asynchronous/streaming.py
@@
-82,9
+82,9
@@
class AsyncStream:
if self.session is None or self.session.closed:
self.session = aiohttp.ClientSession(
- headers={"User-Agent": self.user_agent},
timeout=aiohttp.ClientTimeout(sock_read=stall_timeout)
)
+ self.session.headers["User-Agent"] = self.user_agent
url = f"https://stream.twitter.com/1.1/{endpoint}.json"
url = str(URL(url).with_query(sorted(params.items())))