Introducing scheme for url generation
This requires a new SCHEME value in the config. Prevents browser warnings about insecure links when working with https.
This commit is contained in:
@@ -369,7 +369,8 @@ def generate_link(backend, file_path, project_id=None):
|
||||
blob = storage.Get(file_path)
|
||||
link = blob['signed_url']
|
||||
elif backend == 'pillar':
|
||||
link = url_for('file_storage.index', file_name=file_path, _external=True)
|
||||
link = url_for('file_storage.index', file_name=file_path, _external=True,
|
||||
_scheme=app.config['SCHEME'])
|
||||
elif backend == 'cdnsun':
|
||||
link = hash_file_path(file_path, None)
|
||||
else:
|
||||
|
@@ -11,6 +11,7 @@ class Config(object):
|
||||
|
||||
|
||||
class Development(Config):
|
||||
SCHEME = 'http'
|
||||
STORAGE_DIR = '{0}/application/static/storage'.format(
|
||||
os.path.join(os.path.dirname(__file__)))
|
||||
SHARED_DIR = '/storage/shared'
|
||||
|
Reference in New Issue
Block a user