Skip to content

Commit 24f755e

Browse files
committed
Gzip from middleware
1 parent cda1346 commit 24f755e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/vernier/middleware.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ def call(env)
1818
result = Vernier.trace(interval:, allocation_sample_rate:, hooks: [:rails]) do
1919
@app.call(env)
2020
end
21-
body = result.to_gecko
22-
filename = "#{request.path.gsub("/", "_")}_#{DateTime.now.strftime("%Y-%m-%d-%H-%M-%S")}.vernier.json"
21+
body = result.to_gecko(gzip: true)
22+
filename = "#{request.path.gsub("/", "_")}_#{DateTime.now.strftime("%Y-%m-%d-%H-%M-%S")}.vernier.json.gz"
2323
headers = {
24-
"Content-Type" => "application/json; charset=utf-8",
24+
"Content-Type" => "application/octet-stream",
2525
"Content-Disposition" => "attachment; filename=\"#{filename}\"",
2626
"Content-Length" => body.bytesize.to_s
2727
}

0 commit comments

Comments
 (0)