Skip to content

Commit 831a294

Browse files
Merge pull request #73 from roshenmaghhan/master
Added support for application/octet-stream
2 parents fe72880 + 2093334 commit 831a294

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drf_api_logger/middleware/api_logger_middleware.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@ def __call__(self, request):
102102
if len(self.DRF_API_LOGGER_METHODS) > 0 and method not in self.DRF_API_LOGGER_METHODS:
103103
return response
104104

105-
if response.get('content-type') in ('application/json', 'application/vnd.api+json', 'application/gzip'):
105+
if response.get('content-type') in ('application/json', 'application/vnd.api+json', 'application/gzip', 'application/octet-stream'):
106106

107107
if response.get('content-type') == 'application/gzip':
108108
response_body = '** GZIP Archive **'
109+
elif response.get('content-type') == 'application/octet-stream':
110+
response_body = '** Binary File **'
109111
elif getattr(response, 'streaming', False):
110112
response_body = '** Streaming **'
111113
else:

0 commit comments

Comments
 (0)