mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-28 16:36:48 +09:00
Keep a multi-range upload response's multipart type
A request for several byte ranges gets a 206 multipart/byteranges whose
boundary the client needs to split the body. Rewriting it to
octet-stream lost the boundary. No browser runs that type as a script,
so it passes through.
(cherry picked from commit 9c37f41ff6)
This commit is contained in:
1 parent
05ba551cef
commit
27f7b8a9b0
2 files changed
+9
-2
No files matched your search
@@ -21,6 +21,11 @@ class UploadedScriptGuardTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
test "multi-range responses keep their boundary" do
|
||||
type = "multipart/byteranges; boundary=AaB03x"
|
||||
assert_equal type, served_type(type, "#{ActiveStorage.routes_prefix}/blobs/proxy/key/movie.mp4")
|
||||
end
|
||||
|
||||
test "direct upload responses keep their JSON type" do
|
||||
assert_equal "application/json", served_type("application/json", "#{ActiveStorage.routes_prefix}/direct_uploads", method: "POST")
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user