Description
The problem
When using the HTTPCollectorBot
, it is possible to provide custom headers in the bot's configuration using the http_header
variable. However, when running the bot, these custom headers are ignored, i.e. not passed on in the request.
Probable cause
The HTTPCollectorBot
uses the HttpMixin
class. This class contains a line that sets the instance's variable self.http_header
to an empty dictionary. This overwrites possible custom headers set in the bot's configuration in the manager.
Possible solutions
- Simply commenting out this line seems to fix the problem.
- In
bot.py
there is a functionset_request_parameters
which looks like it is supposed to set the custom headers (among other things). It might be a better solution to move this function to theHttpMixin
and calling it at the start of thesetup
function in theHttpMixin
.