Skip to content
Snippets Groups Projects
Unverified Commit 26aec768 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

skip content-length calculation

parent 4513e9f3
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,6 @@ class MediaController < ApplicationController
before_action :load_blob
def show
@size = @blob.byte_size
if @blob.variable?
variant_service = VariantService.compute(@blob, params[:filename_with_transformations], params[:format])
transformations = variant_service.transformations
......@@ -12,13 +11,11 @@ class MediaController < ApplicationController
blob_or_variant_url = url_for @blob
else
variant = @blob.variant transformations
@size = variant.processed.image.byte_size
blob_or_variant_url = url_for variant
end
else
blob_or_variant_url = url_for(@blob)
end
response.headers["Content-Length"] = "#{@size}"
redirect_to blob_or_variant_url
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