diff --git a/lib/upload_security.rb b/lib/upload_security.rb index baf387450f9..a0c87e5a901 100644 --- a/lib/upload_security.rb +++ b/lib/upload_security.rb @@ -37,6 +37,7 @@ class UploadSecurity category_background group_flair badge_image + site_setting ] PUBLIC_UPLOAD_REFERENCE_TYPES = %w[ diff --git a/spec/system/admin_about_config_area_spec.rb b/spec/system/admin_about_config_area_spec.rb index 6946794c6e1..a6e26fd20c2 100644 --- a/spec/system/admin_about_config_area_spec.rb +++ b/spec/system/admin_about_config_area_spec.rb @@ -139,6 +139,26 @@ describe "Admin About Config Area Page", type: :system do expect(config_area.general_settings_section).to have_saved_successfully expect(SiteSetting.about_banner_image).to eq(nil) end + + context "when login_required is true" do + before { SiteSetting.login_required = true } + + it "doesn't mark the banner image upload as secure" do + setup_or_skip_s3_system_test(enable_secure_uploads: true) + + config_area.visit + + image_file = file_from_fixtures("logo.png", "images") + config_area.general_settings_section.banner_image_uploader.select_image(image_file.path) + expect(config_area.general_settings_section.banner_image_uploader).to have_uploaded_image + + config_area.general_settings_section.submit + + expect(config_area.general_settings_section).to have_saved_successfully + + expect(SiteSetting.about_banner_image.secure).to eq(false) + end + end end end