diff options
author | George Claghorn <george@basecamp.com> | 2018-12-04 13:04:56 -0500 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-12-04 13:05:15 -0500 |
commit | 70c87ea7709ad550c1feaaf7d3831e85d52c032f (patch) | |
tree | 91d46a98f6347068bb1c9c9488fe300f26431982 | |
parent | b404d4e0b4601e4f084fde878ec0c285615fb039 (diff) | |
download | rails-70c87ea7709ad550c1feaaf7d3831e85d52c032f.tar.gz rails-70c87ea7709ad550c1feaaf7d3831e85d52c032f.tar.bz2 rails-70c87ea7709ad550c1feaaf7d3831e85d52c032f.zip |
Include the gem version in the user agent string
-rw-r--r-- | lib/action_mailbox/postfix_relayer.rb | 3 | ||||
-rw-r--r-- | test/unit/postfix_relayer_test.rb | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/action_mailbox/postfix_relayer.rb b/lib/action_mailbox/postfix_relayer.rb index 5a0eb7dca3..eae6184fbb 100644 --- a/lib/action_mailbox/postfix_relayer.rb +++ b/lib/action_mailbox/postfix_relayer.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require "action_mailbox/version" require "net/http" require "uri" @@ -16,7 +17,7 @@ module ActionMailbox end CONTENT_TYPE = "message/rfc822" - USER_AGENT = "Action Mailbox Postfix relayer" + USER_AGENT = "Action Mailbox Postfix relayer v#{ActionMailbox::VERSION}" attr_reader :uri, :username, :password diff --git a/test/unit/postfix_relayer_test.rb b/test/unit/postfix_relayer_test.rb index 550ed2ac7f..9d6e49dee3 100644 --- a/test/unit/postfix_relayer_test.rb +++ b/test/unit/postfix_relayer_test.rb @@ -21,7 +21,7 @@ module ActionMailbox assert_requested :post, URL, body: file_fixture("welcome.eml").read, basic_auth: [ "actionmailbox", INGRESS_PASSWORD ], - headers: { "Content-Type" => "message/rfc822", "User-Agent" => "Action Mailbox Postfix relayer" } + headers: { "Content-Type" => "message/rfc822", "User-Agent" => /\AAction Mailbox Postfix relayer v\d+\./ } end test "unsuccessfully relaying with invalid credentials" do |