We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86faeb8 commit 13a555eCopy full SHA for 13a555e
opencanary/logger.py
@@ -1,3 +1,4 @@
1
+from copy import deepcopy
2
import simplejson as json
3
import logging.config
4
import socket
@@ -334,8 +335,12 @@ def emit(self, record):
334
335
if self.data is None:
336
data = mapping
337
else:
- # Due to the recursive function, sending a shallow copy of self.data here is fine.
338
- data = map_string(dict(self.data), mapping)
+ if isinstance(self.data, dict):
339
+ # Casting logging.config.ConvertingDict to a standard dict
340
+ data = dict(self.data)
341
+ else:
342
+ data = self.data
343
+ data = map_string(deepcopy(data), mapping)
344
345
if "application/json" in self.kwargs.get("headers", {}).values():
346
response = requests.request(method=self.method, url=self.url, json=data, **self.kwargs)
0 commit comments