Skip to content

Commit 0af4869

Browse files
authored
Add a configuration option 'include_request_body' to toggle whether to include the raw body of Django requests (#304)
1 parent 71f5044 commit 0af4869

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rollbar/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def _get_pylons_request():
264264
'http_proxy': None,
265265
'http_proxy_user': None,
266266
'http_proxy_password': None,
267+
'include_request_body': False,
267268
}
268269

269270
_CURRENT_LAMBDA_CONTEXT = None
@@ -1142,6 +1143,12 @@ def _build_django_request_data(request):
11421143
'user_ip': _wsgi_extract_user_ip(request.META),
11431144
}
11441145

1146+
if SETTINGS['include_request_body']:
1147+
try:
1148+
request_data['body'] = request.body
1149+
except:
1150+
pass
1151+
11451152
request_data['headers'] = _extract_wsgi_headers(request.META.items())
11461153

11471154
return request_data

0 commit comments

Comments
 (0)