From 26eff3ed3ecbcd5848ef385d9fe2d494d8bc1ba8 Mon Sep 17 00:00:00 2001 From: Narzhan Date: Wed, 12 Jan 2022 14:32:46 +0100 Subject: [PATCH 1/3] Fix for default overwriting the bot configration --- intelmq/lib/mixins/http.py | 1 - 1 file changed, 1 deletion(-) diff --git a/intelmq/lib/mixins/http.py b/intelmq/lib/mixins/http.py index 6a6befb96..38f0267a6 100644 --- a/intelmq/lib/mixins/http.py +++ b/intelmq/lib/mixins/http.py @@ -50,7 +50,6 @@ class HttpMixin: def __init__(self, **kwargs): self.logger.debug("Running HTTP Mixin initialization.") - self.http_header = {} super().__init__() def setup(self): From 43e15d2259535503704f656faf3d3759a116a860 Mon Sep 17 00:00:00 2001 From: Narzhan Date: Wed, 12 Jan 2022 14:49:41 +0100 Subject: [PATCH 2/3] Fixed unreachable section of user agent substitution --- intelmq/lib/mixins/http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intelmq/lib/mixins/http.py b/intelmq/lib/mixins/http.py index 38f0267a6..610f5ac5f 100644 --- a/intelmq/lib/mixins/http.py +++ b/intelmq/lib/mixins/http.py @@ -69,9 +69,9 @@ def setup(self): self.__auth = (self.http_username, self.http_password) self.__session.auth = self.__auth # headers settings - if self.http_header is not None: + if not self.http_header: self.__session.headers.update(self.http_header) - elif self.http_user_agent is not None: + if self.http_user_agent: self.__session.headers.update({"User-Agent": self.http_user_agent}) # proxy settings From f06b8d4eb266a84cc44397bcfa2635af59afb9f0 Mon Sep 17 00:00:00 2001 From: Narzhan Date: Wed, 12 Jan 2022 14:54:01 +0100 Subject: [PATCH 3/3] Incorrect value check replaced --- intelmq/lib/mixins/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intelmq/lib/mixins/http.py b/intelmq/lib/mixins/http.py index 610f5ac5f..24ef4f2d1 100644 --- a/intelmq/lib/mixins/http.py +++ b/intelmq/lib/mixins/http.py @@ -69,7 +69,7 @@ def setup(self): self.__auth = (self.http_username, self.http_password) self.__session.auth = self.__auth # headers settings - if not self.http_header: + if self.http_header: self.__session.headers.update(self.http_header) if self.http_user_agent: self.__session.headers.update({"User-Agent": self.http_user_agent})