Skip to content

Commit

Permalink
Merge pull request #73 from roshenmaghhan/master
Browse files Browse the repository at this point in the history
Added support for application/octet-stream
  • Loading branch information
vishalanandl177 authored Jun 24, 2023
2 parents fe72880 + 2093334 commit 831a294
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drf_api_logger/middleware/api_logger_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,12 @@ def __call__(self, request):
if len(self.DRF_API_LOGGER_METHODS) > 0 and method not in self.DRF_API_LOGGER_METHODS:
return response

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

if response.get('content-type') == 'application/gzip':
response_body = '** GZIP Archive **'
elif response.get('content-type') == 'application/octet-stream':
response_body = '** Binary File **'
elif getattr(response, 'streaming', False):
response_body = '** Streaming **'
else:
Expand Down

0 comments on commit 831a294

Please sign in to comment.