python-keystoneclient/keystoneclient/tests/unit
Tobias Diaz 3e56e0d7e5 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
keystoneauth sessions, see
I93b6fff73368c4f58bdebf8566c4948b50980cee

Co-Authored-By: Samuel de Medeiros Queiroz <samueldmq@gmail.com>

Closes-bug: 1616105

Change-Id: I8f43eee3a0b35041c6cf672e476f8151cf2f8d14
2017-01-05 10:19:25 -03:00
..
apiclient Move tests to the unit subdirectory 2015-02-11 19:03:25 +11:00
auth Fixing D105 PEP257 2016-05-04 19:47:14 +00:00
generic remove CLI from keystoneclient 2016-03-10 03:51:01 +00:00
v2_0 Do not send user ids as payload 2016-07-29 16:17:44 +03:00
v3 Use assertEqual() instead of assertDictEqual() 2016-07-26 17:15:22 +08:00
__init__.py Move tests to the unit subdirectory 2015-02-11 19:03:25 +11:00
client_fixtures.py Deprecate auth plugins from keystoneclient 2016-02-03 12:08:07 +11:00
test_base.py Add __ne__ built-in function 2016-08-11 11:19:30 +08:00
test_cms.py Fixing D211 PEP257 violation. 2016-05-02 16:36:19 +00:00
test_discovery.py httpclient: remove unused debug kwargs 2016-05-02 22:23:54 +00:00
test_ec2utils.py Address hacking check H405 2016-01-13 13:03:51 -08:00
test_fixtures.py Add endpoint and service ids to fixtures 2015-04-17 09:16:00 +10:00
test_hacking_checks.py move hacking to tests folder 2015-12-15 18:08:38 -05:00
test_http.py Prevent MemoryError when logging response bodies 2017-01-05 10:19:25 -03:00
test_https.py Replace TestResponse with requests_mock 2016-01-25 09:56:34 +11:00
test_keyring.py Fixing D204, D205, and D207 PEP257 violation. 2016-05-04 19:30:03 +00:00
test_session.py Prevent MemoryError when logging response bodies 2017-01-05 10:19:25 -03:00
test_utils.py remove CLI from keystoneclient 2016-03-10 03:51:01 +00:00
utils.py Use assertEqual() instead of assertDictEqual() 2016-07-26 17:15:22 +08:00