Skip to content

Commit

Permalink
Parameter for public URL protocol
Browse files Browse the repository at this point in the history
Control public URL protocol with a dedicated "public_url_use_https"
parameter.
  • Loading branch information
junousi committed Mar 4, 2019
1 parent 27d7806 commit 61a2d20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions S3/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ class Config(object):
# Maximum sleep duration for throtte / limitrate.
# s3 will timeout if a request/transfer is stuck for more than a short time
throttle_max = 100
public_url_use_https = False

## Creating a singleton
def __new__(self, configfile = None, access_key=None, secret_key=None, access_token=None):
Expand Down
2 changes: 1 addition & 1 deletion S3/S3Uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def is_dns_compatible(self):

def public_url(self):
public_url_protocol = "http"
if Config.Config().use_https:
if Config.Config().public_url_use_https:
public_url_protocol = "https"
if self.is_dns_compatible():
return "%s://%s.%s/%s" % (public_url_protocol, self._bucket, Config.Config().host_base, self._object)
Expand Down

0 comments on commit 61a2d20

Please sign in to comment.