Skip to content
Snippets Groups Projects
Commit 713fe9f4 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

content-length

parent 8d507195
No related branches found
No related tags found
No related merge requests found
class MediaController < ApplicationController
def show
@blob = ActiveStorage::Blob.find_signed! params[:signed_id]
@size = @blob.byte_size
if @blob.variable?
variant_service = VariantService.compute(@blob, params[:filename_with_transformations], params[:format])
transformations = variant_service.transformations
......@@ -8,7 +9,7 @@ class MediaController < ApplicationController
else
blob_or_variant_url = url_for(@blob)
end
response.headers["Content-Length"] = "#{@size}"
redirect_to blob_or_variant_url
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment