11import json
22import time
3+ import re
34from django .conf import settings
45from django .urls import resolve
56from django .utils import timezone
@@ -101,8 +102,11 @@ def __call__(self, request):
101102 if len (self .DRF_API_LOGGER_METHODS ) > 0 and method not in self .DRF_API_LOGGER_METHODS :
102103 return response
103104
104- if response .get ('content-type' ) in ('application/json' , 'application/vnd.api+json' ,):
105- if getattr (response , 'streaming' , False ):
105+ if response .get ('content-type' ) in ('application/json' , 'application/vnd.api+json' , 'application/gzip' ):
106+
107+ if response .get ('content-type' ) == 'application/gzip' :
108+ response_body = '** GZIP Archive **'
109+ elif getattr (response , 'streaming' , False ):
106110 response_body = '** Streaming **'
107111 else :
108112 if type (response .content ) == bytes :
@@ -119,7 +123,7 @@ def __call__(self, request):
119123 api = request .build_absolute_uri ()
120124
121125 data = dict (
122- api = api ,
126+ api = mask_sensitive_data ( api , mask_api_parameters = True ) ,
123127 headers = mask_sensitive_data (headers ),
124128 body = mask_sensitive_data (request_data ),
125129 method = method ,
0 commit comments