diff --git a/shard.yml b/shard.yml index 9f7d025..5e4fa7c 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: action-controller -version: 7.2.1 +version: 7.2.2 crystal: ">= 1.9.0" dependencies: diff --git a/src/action-controller/base.cr b/src/action-controller/base.cr index 9349088..53fc4df 100644 --- a/src/action-controller/base.cr +++ b/src/action-controller/base.cr @@ -135,18 +135,6 @@ abstract class ActionController::Base @__render_called__ = false end - # clean up any uploaded files - def finalize - uploads = @__files__ - return unless uploads - - uploads.each_value do |files| - files.each do |file_upload| - file_upload.delete - end - end - end - # the [request context](https://crystal-lang.org/api/latest/HTTP/Server/Context.html) def context : HTTP::Server::Context @__context__ @@ -591,6 +579,15 @@ abstract class ActionController::Base end # END force SSL check {% end %} + # clean up any uploaded files + if uploads = instance.try &.@__files__ + uploads.each_value do |files| + files.each do |file_upload| + file_upload.delete + end + end + end + # Always return the context context end