|
|
|
@ -366,8 +366,15 @@ class Session(object):
|
|
|
|
|
# stream of bytes and getting an unexpected MemoryError. See
|
|
|
|
|
# bug 1616105 for further details.
|
|
|
|
|
content_type = response.headers.get('content-type', None)
|
|
|
|
|
if content_type in _LOG_CONTENT_TYPES:
|
|
|
|
|
text = self._remove_service_catalog(response.text)
|
|
|
|
|
|
|
|
|
|
# NOTE(lamt): Per [1], the Content-Type header can be of the
|
|
|
|
|
# form Content-Type := type "/" subtype *[";" parameter]
|
|
|
|
|
# [1] https://www.w3.org/Protocols/rfc1341/4_Content-Type.html
|
|
|
|
|
for log_type in _LOG_CONTENT_TYPES:
|
|
|
|
|
if content_type is not None and content_type.startswith(
|
|
|
|
|
log_type):
|
|
|
|
|
text = self._remove_service_catalog(response.text)
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
text = ('Omitted, Content-Type is set to %s. Only '
|
|
|
|
|
'%s responses have their bodies logged.')
|
|
|
|
|