1
1
import json
2
2
import time
3
+ import re
3
4
from django .conf import settings
4
5
from django .urls import resolve
5
6
from django .utils import timezone
@@ -101,8 +102,11 @@ def __call__(self, request):
101
102
if len (self .DRF_API_LOGGER_METHODS ) > 0 and method not in self .DRF_API_LOGGER_METHODS :
102
103
return response
103
104
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 ):
106
110
response_body = '** Streaming **'
107
111
else :
108
112
if type (response .content ) == bytes :
@@ -119,7 +123,7 @@ def __call__(self, request):
119
123
api = request .build_absolute_uri ()
120
124
121
125
data = dict (
122
- api = api ,
126
+ api = mask_sensitive_data ( api , mask_api_parameters = True ) ,
123
127
headers = mask_sensitive_data (headers ),
124
128
body = mask_sensitive_data (request_data ),
125
129
method = method ,
0 commit comments