Skip to content

Custom headers ignored in HTTPCollectorBot  #2150

@frank9524

Description

@frank9524

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

  1. Simply commenting out this line seems to fix the problem.
  2. In bot.py there is a function set_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 the HttpMixin and calling it at the start of the setup function in the HttpMixin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcomponent: botshelp wantedIndicates that a maintainer wants help on an issue or pull request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions