Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/raven/processor/sanitizedata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def sanitize_query_string(query_string)
end

def fields_re
@fields_re ||= /(#{(DEFAULT_FIELDS + @sanitize_fields).join("|")})/i
@fields_re ||= /(#{(DEFAULT_FIELDS | @sanitize_fields).join("|")})/i
end
end
end
Expand Down
12 changes: 12 additions & 0 deletions spec/raven/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,16 @@
end
end

context 'configuration for sanitize fields' do
it 'should union default sanitize fields with user-defined sanitize fields' do
fields = Raven::Processor::SanitizeData::DEFAULT_FIELDS | %w(test monkeybutt)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use a field like "password" or something? Neither of the fields you're adding here are in DEFAULT_FIELDS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but I'm adding those to the list of default fields and assigning all of that to sanitize_fields.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right you are!


subject.sanitize_fields = fields
client = Raven::Client.new(subject)
processor = Raven::Processor::SanitizeData.new(client)

expect(processor.send(:fields_re)).to eq(/(#{fields.join('|')})/i)
end
end

end