Indicate full version in UserAgent HTTP header
This commit is contained in:
parent
1a04a107ac
commit
0d21b1fa2c
2 changed files with 7 additions and 3 deletions
|
@ -4,6 +4,7 @@ import subprocess
|
|||
import tempfile
|
||||
import urllib
|
||||
|
||||
from bot import __version__
|
||||
from tools import web
|
||||
|
||||
|
||||
|
@ -27,7 +28,8 @@ def headers(url):
|
|||
else:
|
||||
conn = http.client.HTTPSConnection(o.hostname, port=o.port, timeout=5)
|
||||
try:
|
||||
conn.request("HEAD", o.path, None, {"User-agent": "Nemubot v3"})
|
||||
conn.request("HEAD", o.path, None, {"User-agent":
|
||||
"Nemubot v%s" % __version__})
|
||||
except socket.timeout:
|
||||
raise IRCException("request timeout")
|
||||
except socket.gaierror:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue