FEATURE: Add setting to disable automatic CORS rule install in S3 buckets (#9872)

This commit is contained in:
Rafael dos Santos Silva 2020-05-25 17:09:34 -03:00 committed by GitHub
parent d9f915b195
commit b48299f81c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -200,6 +200,7 @@ s3_use_iam_profile =
s3_cdn_url =
s3_endpoint =
s3_http_continue_timeout =
s3_install_cors_rule =
### rate limits apply to all sites
max_user_api_reqs_per_minute = 20

View File

@ -1207,6 +1207,9 @@ files:
s3_http_continue_timeout:
default: 1
hidden: true
s3_install_cors_rule:
default: true
hidden: true
s3_cdn_url:
default: ""
regex: '^https?:\/\/.+[^\/]$'

View File

@ -90,6 +90,8 @@ class S3Helper
# make sure we have a cors config for assets
# otherwise we will have no fonts
def ensure_cors!(rules = nil)
return unless SiteSetting.s3_install_cors_rule
rule = nil
begin