Commit 5e45e77c authored by Romain Bignon's avatar Romain Bignon Committed by ntome

Module.create_browser: read _proxy_headers from config

It may contain a dict encoded with json
parent 658d30e9
......@@ -25,6 +25,7 @@ from weboob.capabilities.base import BaseObject, Capability, FieldNotFound, NotA
from weboob.exceptions import ModuleInstallError
from weboob.tools.compat import basestring, getproxies
from weboob.tools.log import getLogger
from weboob.tools.json import json
from weboob.tools.misc import iter_fields
from weboob.tools.value import ValuesDict
......@@ -353,6 +354,11 @@ class Module(object):
return None
kwargs['proxy'] = self.get_proxy()
if '_proxy_headers' in self._private_config:
kwargs['proxy_headers'] = self._private_config['_proxy_headers']
if isinstance(kwargs['proxy_headers'], basestring):
kwargs['proxy_headers'] = json.loads(kwargs['proxy_headers'])
kwargs['logger'] = self.logger
if self.logger.settings['responses_dirname']:
......
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