File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
activestorage/test/controllers/blobs Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,17 @@ class ActiveStorage::Blobs::ProxyControllerTest < ActionDispatch::IntegrationTes
137
137
assert request . session_options [ :skip ] ,
138
138
"Expected request.session_options[:skip] to be true"
139
139
end
140
+
141
+ test "rails_storage_proxy include Content-Length header" do
142
+ Rails . application . config . active_storage . resolve_model_to_route = :rails_storage_proxy
143
+ blob = create_file_blob ( filename : "racecar.jpg" )
144
+
145
+ get rails_storage_proxy_url ( blob )
146
+
147
+ assert_response :success
148
+ assert_not_nil response . headers [ "Content-Length" ] , "Content-Length header should be included in proxy mode"
149
+ assert_equal blob . byte_size . to_s , response . headers [ "Content-Length" ] , "Content-Length header should match blob size"
150
+ end
140
151
end
141
152
142
153
class ActiveStorage ::Blobs ::ExpiringProxyControllerTest < ActionDispatch ::IntegrationTest
You can’t perform that action at this time.
0 commit comments