Commit 094a51dd authored by Jason R. Coombs's avatar Jason R. Coombs

Move setuptools to beginning of user-agent header. Fixes #598.

parent f0a0f6f4
...@@ -2,6 +2,14 @@ ...@@ -2,6 +2,14 @@
CHANGES CHANGES
======= =======
v21.3.0
-------
* #598: Setuptools now lists itself first in the User-Agent
for web requests, better following the guidelines in
`RFC 7231
<https://tools.ietf.org/html/rfc7231#section-5.5.3>`_.
v21.2.2 v21.2.2
------- -------
......
...@@ -202,8 +202,8 @@ def find_external_links(url, page): ...@@ -202,8 +202,8 @@ def find_external_links(url, page):
if match: if match:
yield urllib.parse.urljoin(url, htmldecode(match.group(1))) yield urllib.parse.urljoin(url, htmldecode(match.group(1)))
user_agent = "Python-urllib/%s setuptools/%s" % ( user_agent = "setuptools/%s Python-urllib/%s" % (
sys.version[:3], require('setuptools')[0].version require('setuptools')[0].version, sys.version[:3],
) )
class ContentChecker(object): class ContentChecker(object):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment