[openstreetmap/openstreetmap-website] Compress plain GPX uploads with gzip (PR #7124)
Pablo Brasero
notifications at github.com
Tue Jun 23 09:24:36 UTC 2026
@pablobm 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)
I think it's good that the flag is not deleted. In the future it might be useful to have tagged in DB which files used this facility. Is there a way to test that it's indeed kept in the ActiveStorage metadata? Currently I think the tests don't complain if there's a `delete` instead of just checking the value and then using `except` (like you did).
The other thing is: is `send_data(trace.xml_file.read, ...)` a dead code path now? Is there a circumstance that would use it?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7124#discussion_r3458528241
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7124/review/4551812358 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260623/7b8cc0b7/attachment.htm>
More information about the rails-dev
mailing list