From d15b7db1216f220b9f5af7e777cf04712483cbdf Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Tue, 17 Jan 2017 14:50:49 -0500 Subject: Fix References header parser for Microsoft Exchange Microsoft Exchange would append a comma and another message id into the References header, therefore we'll need to fallback and parse the header by ourselves. Closes #26567 --- spec/lib/gitlab/incoming_email_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'spec/lib/gitlab/incoming_email_spec.rb') diff --git a/spec/lib/gitlab/incoming_email_spec.rb b/spec/lib/gitlab/incoming_email_spec.rb index 1dcf2c0668b..01d0cb6cbd6 100644 --- a/spec/lib/gitlab/incoming_email_spec.rb +++ b/spec/lib/gitlab/incoming_email_spec.rb @@ -48,4 +48,19 @@ describe Gitlab::IncomingEmail, lib: true do expect(described_class.key_from_fallback_message_id('reply-key@localhost')).to eq('key') end end + + context 'self.scan_fallback_references' do + let(:references) do + '' + + ' ' + + ',' + end + + it 'returns reply key' do + expect(described_class.scan_fallback_references(references)) + .to eq(%w[issue_1@localhost + reply-59d8df8370b7e95c5a49fbf86aeb2c93@localhost + exchange@microsoft.com]) + end + end end -- cgit v1.2.3