aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2017-07-27 16:52:57 -0400
committerGeorge Claghorn <george@basecamp.com>2017-07-27 16:52:57 -0400
commita9091eaa67bd2ebbb4876549ff33a33600276040 (patch)
treedb2b3adedadc9481da2d92150afee376f0c13042 /app
parente64e3f14fd255d91ac0aa7a272741df08da82701 (diff)
downloadrails-a9091eaa67bd2ebbb4876549ff33a33600276040.tar.gz
rails-a9091eaa67bd2ebbb4876549ff33a33600276040.tar.bz2
rails-a9091eaa67bd2ebbb4876549ff33a33600276040.zip
Validate Content-Length
Diffstat (limited to 'app')
-rw-r--r--app/controllers/active_storage/disk_controller.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/controllers/active_storage/disk_controller.rb b/app/controllers/active_storage/disk_controller.rb
index 6be88d2857..76377a0f20 100644
--- a/app/controllers/active_storage/disk_controller.rb
+++ b/app/controllers/active_storage/disk_controller.rb
@@ -45,9 +45,7 @@ class ActiveStorage::DiskController < ActionController::Base
ActiveStorage.verifier.verified(params[:encoded_token], purpose: :blob_token)
end
- # FIXME: Validate Content-Length when we're using integration tests. Controller tests don't
- # populate the header properly when a request body is provided.
def acceptable_content?(token)
- token[:content_type] == request.content_type
+ token[:content_type] == request.content_type && token[:content_length] == request.content_length
end
end