Commit 329e7b48 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Remove context from markup rendering error logging

The context contains rich objects, which would get serialized as JSON
and would cause many useless fields inside ES or leak secrets.
parent 21a3fb65
...@@ -153,7 +153,7 @@ module MarkupHelper ...@@ -153,7 +153,7 @@ module MarkupHelper
other_markup_unsafe(file_name, text, context) other_markup_unsafe(file_name, text, context)
end end
rescue StandardError => e rescue StandardError => e
Gitlab::ErrorTracking.track_exception(e, project_id: @project&.id, file_name: file_name, context: context) Gitlab::ErrorTracking.track_exception(e, project_id: @project&.id, file_name: file_name)
simple_format(text) simple_format(text)
end end
......
---
title: Don't leak entire objects into the error log when rendering markup fails
merge_request: 24599
author:
type: fixed
...@@ -403,7 +403,7 @@ describe MarkupHelper do ...@@ -403,7 +403,7 @@ describe MarkupHelper do
it 'logs the error' do it 'logs the error' do
expect(Gitlab::ErrorTracking).to receive(:track_exception).with( expect(Gitlab::ErrorTracking).to receive(:track_exception).with(
instance_of(StandardError), instance_of(StandardError),
project_id: project.id, file_name: 'foo.md', context: context project_id: project.id, file_name: 'foo.md'
) )
subject subject
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment