[guillaume] add user-agent when downloading a remote image. Fixes #5513
This commit is contained in:
parent
4b07509d5e
commit
2eb8391e81
|
@ -489,7 +489,9 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
|
||||||
# Wait maximum 1s for connection
|
# Wait maximum 1s for connection
|
||||||
socket.setdefaulttimeout(1)
|
socket.setdefaulttimeout(1)
|
||||||
try:
|
try:
|
||||||
f = urllib2.urlopen(attrs['src'])
|
req = urllib2.Request(attrs['src'])
|
||||||
|
req.add_header('User-Agent', 'Gajim ' + gajim.version)
|
||||||
|
f = urllib2.urlopen(req)
|
||||||
except Exception, ex:
|
except Exception, ex:
|
||||||
gajim.log.debug('Error loading image %s ' % attrs['src'] + str(ex))
|
gajim.log.debug('Error loading image %s ' % attrs['src'] + str(ex))
|
||||||
pixbuf = None
|
pixbuf = None
|
||||||
|
|
Loading…
Reference in New Issue