Skip to content

Commit baf5879

Browse files
committed
Simplify call to gzip the request body
1 parent 9e743a6 commit baf5879

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/models/app_size_metrics_payload.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ def send_metrics(base_url:, api_token:)
5757
}
5858
request = Net::HTTP::Post.new(uri, headers)
5959

60-
gzip = Zlib::GzipWriter.new(StringIO.new)
61-
gzip << to_h.to_json
62-
request.body = gzip.close.string
60+
request.body = Zlib.gzip(to_h.to_json)
6361

6462
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
6563
http.request(request)

0 commit comments

Comments
 (0)