Skip to content

Commit

Permalink
[TWEAK] Remove ascii encode
Browse files Browse the repository at this point in the history
  • Loading branch information
ssunday committed Sep 29, 2022
1 parent e2593e6 commit 16937b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/net/imap/authenticators/xoauth2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize(user, oauth2_token)
end

def build_oauth2_string(user, oauth2_token)
format("user=%s\1auth=Bearer %s\1\1".encode('us-ascii'), user, oauth2_token)
format("user=%s\1auth=Bearer %s\1\1", user, oauth2_token)
end

Net::IMAP.add_authenticator 'XOAUTH2', self
Expand Down
2 changes: 1 addition & 1 deletion test/net/imap/test_imap_authenticators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_plain_no_null_chars

def test_xoauth2
assert_equal(
"user=username\1auth=Bearer token\1\1".encode('us-ascii'),
"user=username\1auth=Bearer token\1\1",
Net::IMAP::XOauth2Authenticator.new("username", "token").process(nil)
)
end
Expand Down

0 comments on commit 16937b7

Please sign in to comment.