mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-20 05:06:30 +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.
This commit is contained in:
1 parent
d713f2631d
commit
9c37f41ff6
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