When whitelisting content types to debug print from session we chose
application/json and application/text. application/text is not a real
mime type, text is typically text/plain.
Rather than guess at mime types only print application/json to start
with, but make it easy for additional types to be added later.
Adapted from keystoneauth: Ica5fee076cdab8b1d5167161d28af7313fad9477
Related-Bug: 1616105
Reviewed: https:/ /review. openstack. org/418682 /git.openstack. org/cgit/ openstack/ python- keystoneclient/ commit/ ?id=a0c67b860b3 c5ff6f5fbb0e406 dcbc3fd7aa9f88
Committed: https:/
Submitter: Jenkins
Branch: stable/mitaka
commit a0c67b860b3c5ff 6f5fbb0e406dcbc 3fd7aa9f88
Author: Tobias Diaz <email address hidden>
Date: Tue Aug 23 17:13:24 2016 +0200
Only log application/json content type
This is a combination of 2 commits. The first commit's
message is:
Prevent MemoryError when logging response bodies
Response bodies are loaded into memory prior to
being logged.
Loading huge response bodies may result in a
MemoryError.
This patch proposes that only JSON and TEXT
responses be logged, i.e when the Content-Type
header is application/json or application/text.
Responses that do not include or have a different
Content-Type header will have their body omitted.
This is a sort of backport of the fix for 68c4f58bdebf856 6c4948b50980cee
keystoneauth sessions, see
I93b6fff733
Co-Authored-By: Samuel de Medeiros Queiroz <email address hidden>
Closes-bug: 1616105
Change-Id: I8f43eee3a0b350 41c6cf672e476f8 151cf2f8d14 d806a3bc1f6d5ef 9070f95771)
(cherry-picked from: 3e56e0d7e5e1a76
Only log application/json in session to start
When whitelisting content types to debug print from session we chose /json and application/text. application/text is not a real
application
mime type, text is typically text/plain.
Rather than guess at mime types only print application/json to start
with, but make it easy for additional types to be added later.
Adapted from keystoneauth: Ica5fee076cdab8 b1d5167161d28af 7313fad9477
Related-Bug: 1616105
Change-Id: Ieaa8fb3ea8d25e 09b89498f23b70b 18c0f6153f1 df454faf5e0c453 5a8f96a7c8)
(cherry-picked from: 51d16fa344829aa