Skip to content

Commit 3ce00fd

Browse files
committed
x-gzip64 decoder for Mail gem
1 parent 5ac27ba commit 3ce00fd

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lib/mail/encodings/x_gzip64.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
require 'mail/encodings/base64'
4+
require 'zlib'
5+
6+
module Mail
7+
module Encodings
8+
class XGzip64 < Base64
9+
NAME = 'x-gzip64'
10+
PRIORITY = 3
11+
Encodings.register(NAME, self)
12+
13+
def self.decode(str)
14+
base64str = Utilities.decode_base64(str)
15+
ActiveSupport::Gzip.decompress(base64str)
16+
end
17+
end
18+
end
19+
end

0 commit comments

Comments
 (0)