diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b37da70ea5..b255f90db5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,10 +7,15 @@ in development Fixed ~~~~~ +* Fixed logging middleware to output a ``content_length`` of ``0`` instead of ``Infinity`` + when the type of data being returned is not supported. Previously, when the value was + set to ``Infinity`` this would result in invalid JSON being output into structured + logs. (bug fix) #4722 + + Contributed by Nick Maludy (@nmaludy Encore Technologies) * Fix the workflow execution cancelation to proceed even if the workflow execution is not found or completed. (bug fix) #4735 - 3.1.0 - June 27, 2019 --------------------- diff --git a/st2common/st2common/middleware/logging.py b/st2common/st2common/middleware/logging.py index 66c32187c7..fa984a60b6 100644 --- a/st2common/st2common/middleware/logging.py +++ b/st2common/st2common/middleware/logging.py @@ -99,7 +99,7 @@ def custom_start_response(status, headers, exc_info=None): if isinstance(retval, (types.GeneratorType, itertools.chain)): # Note: We don't log the result when return value is a generator, because this would # result in calling str() on the generator and as such, exhausting it - content_length = [float('inf')] + content_length = [0] log_result = False # Log the response