[openstreetmap/openstreetmap-website] Compress plain GPX uploads with gzip (PR #7124)

Ruben L. Mendoza notifications at github.com
Wed Jun 24 16:27:09 UTC 2026


@Rub21 commented on this pull request.



> @@ -0,0 +1,43 @@
+# frozen_string_literal: true
+
+module GpxDownloadMethods
+  extend ActiveSupport::Concern
+
+  private
+
+  # Send the stored trace file to the client. It can go back two ways.
+  # - If the store serves gzip (S3) and the client accepts it, redirect and let the client unzip it.
+  # - Otherwise the server unzips it first and sends plain GPX.
+  def send_trace_file(trace)
+    if gzipped_by_server?(trace)

> Is there a way to test that it's indeed kept in the ActiveStorage metadata?

I added test_keeps_metadata_flag. It uploads with the flag and checks that the service keeps it

> is send_data(trace.xml_file.read, ...) a dead code path now?

It's not dead. It runs for a server-gzipped trace when the client doesn't accept gzip, or when the store doesn't serve the header (Disk, or plain S3). The controller tests already hit it on Disk.





-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7124#discussion_r3468668732
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/7124/review/4564062337 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260624/a197a66e/attachment.htm>


More information about the rails-dev mailing list