Skip to content

Commit f8eb112

Browse files
committed
add text/calendar support
1 parent 84d79fa commit f8eb112

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drf_api_logger/middleware/api_logger_middleware.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def __call__(self, request):
164164
"application/vnd.api+json",
165165
"application/gzip",
166166
"application/octet-stream",
167+
"text/calendar",
167168
]
168169
if hasattr(settings, "DRF_API_LOGGER_CONTENT_TYPES") and type(
169170
settings.DRF_API_LOGGER_CONTENT_TYPES
@@ -179,6 +180,9 @@ def __call__(self, request):
179180
response_body = '** Binary File **'
180181
elif getattr(response, 'streaming', False):
181182
response_body = '** Streaming **'
183+
elif response.get('content-type') == 'text/calendar':
184+
response_body = '** Calendar **'
185+
182186
else:
183187
if type(response.content) is bytes:
184188
response_body = json.loads(response.content.decode())

0 commit comments

Comments
 (0)