summaryrefslogtreecommitdiff
path: root/lib/additional_email_headers_interceptor.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-10-30 13:50:19 +0000
committerSean McGivern <sean@gitlab.com>2017-10-30 13:50:19 +0000
commiteddc9e41a6df94e55f9df91241a83e2ae3439c49 (patch)
treefe4f01450914bebae4bfaee4191564c090cf5edc /lib/additional_email_headers_interceptor.rb
parent9a58468bee9a28d5762fb9f75e4d457552f943c8 (diff)
downloadgitlab-ce-eddc9e41a6df94e55f9df91241a83e2ae3439c49.tar.gz
The emails on push feature reuses the same email object, to avoid the expensive work of generating the email body. This interceptor would previously set multiple values for the same header, as that's the mail gem's default behaviour when called with the same header more than once. We don't want to change the emails on push service (although it's the only place where this happens), but fixing the interceptor is just as sensible anyway.
Diffstat (limited to 'lib/additional_email_headers_interceptor.rb')
-rw-r--r--lib/additional_email_headers_interceptor.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/additional_email_headers_interceptor.rb b/lib/additional_email_headers_interceptor.rb
index 2358fa6bbfd..3cb1694b9f1 100644
--- a/lib/additional_email_headers_interceptor.rb
+++ b/lib/additional_email_headers_interceptor.rb
@@ -1,8 +1,6 @@
class AdditionalEmailHeadersInterceptor
def self.delivering_email(message)
- message.headers(
- 'Auto-Submitted' => 'auto-generated',
- 'X-Auto-Response-Suppress' => 'All'
- )
+ message.header['Auto-Submitted'] ||= 'auto-generated'
+ message.header['X-Auto-Response-Suppress'] ||= 'All'
end
end