mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
Filter out "content" and "secret" from exceptions.
(imported from commit 31206f528fc93746133ebe2d9234b6ce0b88cf3b)
This commit is contained in:
@@ -250,3 +250,7 @@ if not deployed:
|
||||
PASSWORD_HASHERS = (
|
||||
'django.contrib.auth.hashers.SHA1PasswordHasher',
|
||||
)
|
||||
|
||||
if deployed:
|
||||
# Filter out user data
|
||||
DEFAULT_EXCEPTION_REPORTER_FILTER = 'zephyr.filters.HumbugExceptionReporterFilter'
|
||||
|
||||
10
zephyr/filters.py
Normal file
10
zephyr/filters.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from django.views.debug import SafeExceptionReporterFilter
|
||||
|
||||
class HumbugExceptionReporterFilter(SafeExceptionReporterFilter):
|
||||
def get_post_parameters(self, request):
|
||||
filtered_post = SafeExceptionReporterFilter.get_post_parameters(self, request)
|
||||
if 'content' in filtered_post:
|
||||
filtered_post['content'] = '**********'
|
||||
if 'secret' in filtered_post:
|
||||
filtered_post['secret'] = '**********'
|
||||
return filtered_post
|
||||
Reference in New Issue
Block a user