-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Labels
Description
From https://tools.ietf.org/html/rfc7231:
A user agent SHOULD send a User-Agent field in each request unless specifically configured not to do so.
CurlAsyncHTTPClient provides default User-Agent string:
tornado/tornado/curl_httpclient.py
Lines 380 to 383 in c92b883
| if request.user_agent: | |
| curl.setopt(pycurl.USERAGENT, native_str(request.user_agent)) | |
| else: | |
| curl.setopt(pycurl.USERAGENT, "Mozilla/5.0 (compatible; pycurl)") |
While SimpleAsyncHTTPClient writes User-Agent only when it's provided by the user:
tornado/tornado/simple_httpclient.py
Lines 393 to 396 in c92b883
| if self.request.user_agent: | |
| self.request.headers["User-Agent"] = self.request.user_agent | |
| if not self.request.allow_nonstandard_methods: | |
| # Some HTTP methods nearly always have bodies while others |
Could you consider adding default User-Agent string in SimpleAsyncHTTPClient?