Skip to content

Commit

Permalink
FEATURE: Add setting to controle the Expect header on S3 calls
Browse files Browse the repository at this point in the history
Some providers don't implement the Expect: 100-continue support,
which results in a mismatch in the object signature.

With this settings, users can disable the header and use such providers.
  • Loading branch information
xfalcox committed Apr 30, 2020
1 parent 45f7049 commit 08e4af6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/discourse_defaults.conf
Expand Up @@ -196,6 +196,7 @@ s3_secret_access_key =
s3_use_iam_profile =
s3_cdn_url =
s3_endpoint =
s3_http_continue_timeout =

### rate limits apply to all sites
max_user_api_reqs_per_minute = 20
Expand Down
3 changes: 3 additions & 0 deletions config/site_settings.yml
Expand Up @@ -1202,6 +1202,9 @@ files:
s3_endpoint:
default: ""
regex: '^https?:\/\/.+[^\/]$'
s3_http_continue_timeout:
default: 1
hidden: true
s3_cdn_url:
default: ""
regex: '^https?:\/\/.+[^\/]$'
Expand Down
1 change: 1 addition & 0 deletions lib/s3_helper.rb
Expand Up @@ -204,6 +204,7 @@ def self.s3_options(obj)
}

opts[:endpoint] = SiteSetting.s3_endpoint if SiteSetting.s3_endpoint.present?
opts[:http_continue_timeout] = SiteSetting.s3_http_continue_timeout

unless obj.s3_use_iam_profile
opts[:access_key_id] = obj.s3_access_key_id
Expand Down

0 comments on commit 08e4af6

Please sign in to comment.