mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #30424 from koic/fix_order_of_active_storage_disk_url_parameters
Fix order of Active Storage DiskService URL parameters
This commit is contained in:
commit
a8bc4bd41e
2 changed files with 2 additions and 2 deletions
|
@ -66,7 +66,7 @@ module ActiveStorage
|
|||
verified_key_with_expiration,
|
||||
filename: filename, disposition: disposition, content_type: content_type
|
||||
else
|
||||
"/rails/active_storage/disk/#{verified_key_with_expiration}/#{filename}?disposition=#{disposition}&content_type=#{content_type}"
|
||||
"/rails/active_storage/disk/#{verified_key_with_expiration}/#{filename}?content_type=#{content_type}&disposition=#{disposition}"
|
||||
end
|
||||
|
||||
payload[:url] = generated_url
|
||||
|
|
|
@ -8,7 +8,7 @@ class ActiveStorage::Service::DiskServiceTest < ActiveSupport::TestCase
|
|||
include ActiveStorage::Service::SharedServiceTests
|
||||
|
||||
test "url generation" do
|
||||
assert_match(/rails\/active_storage\/disk\/.*\/avatar\.png\?.+disposition=inline/,
|
||||
assert_match(/rails\/active_storage\/disk\/.*\/avatar\.png\?content_type=image%2Fpng&disposition=inline/,
|
||||
@service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: "inline; filename=\"avatar.png\"", filename: "avatar.png", content_type: "image/png"))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue