A platform for community discussion. Free, open, simple.
DEV: allow plugins to override max file size for avatar downloads (#16970)
Jeff Wong2dd09b4b6a71
diff --git a/app/controllers/user_avatars_controller.rb b/app/controllers/user_avatars_controller.rbindex cc28143c0db..3f148cb477a 100644--- a/app/controllers/user_avatars_controller.rb+++ b/app/controllers/user_avatars_controller.rb@@ -142,6 +142,11 @@ class UserAvatarsController < ApplicationControllerrender_blankend+ # Allow plugins to overwrite max file size value+ def max_file_size+ 1.megabyte+ end+PROXY_PATH = Rails.root + "tmp/avatar_proxy"def proxy_avatar(url, last_modified)@@ -157,7 +162,7 @@ class UserAvatarsController < ApplicationControllerFileUtils.mkdir_p PROXY_PATHtmp = FileHelper.download(url,- max_file_size: 1.megabyte,+ max_file_size: max_file_size,tmp_file_name: filename,follow_redirect: true,read_timeout: 10