Google: *copy* the utils.web.defaultHeaders before adding items to it.

This commit is contained in:
Valentin Lorentz 2014-01-14 20:55:56 +00:00
parent 8e023ed8c6
commit 5341df0254

View File

@ -94,7 +94,7 @@ class Google(callbacks.PluginRegexp):
if not ref:
ref = 'http://%s/%s' % (dynamic.irc.server,
dynamic.irc.nick)
headers = utils.web.defaultHeaders
headers = dict(utils.web.defaultHeaders)
headers['Referer'] = ref
opts = {'q': query, 'v': '1.0'}
for (k, v) in options.iteritems():
@ -250,7 +250,7 @@ class Google(callbacks.PluginRegexp):
channel = msg.args[0]
headers = utils.web.defaultHeaders
headers = dict(utils.web.defaultHeaders)
headers['User-Agent'] = ('Mozilla/5.0 (X11; U; Linux i686) '
'Gecko/20071127 Firefox/2.0.0.11')