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:
2015-11-09 17:41:54 +01:00
parent de3bc0e864
commit 9fefee800c
2 changed files with 3 additions and 1 deletions

View File

@@ -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:

View File

@@ -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'