Skip to content
Snippets Groups Projects
Commit 7ebe39e8 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

[guillaume] add user-agent when downloading a remote image. Fixes #5513

parent 62b9b429
No related branches found
No related tags found
No related merge requests found
......@@ -488,7 +488,9 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
# Wait maximum 1s for connection
socket.setdefaulttimeout(1)
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:
gajim.log.debug('Error loading image %s ' % attrs['src'] + str(ex))
pixbuf = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment