| |
@@ -53,7 +53,20 @@
|
| |
if os.getenv('DEBUG') == 'true':
|
| |
app.config["DEBUG"] = True
|
| |
|
| |
- # "Hotfix" for proxy handling on current deployment, my guess is that the proxy server is set differently than it was, but what do I know...
|
| |
+ # Make sure config URLs end with a slash, so that we have them all in an
|
| |
+ # expected format
|
| |
+ def end_with_slash(url):
|
| |
+ if not url.endswith('/'):
|
| |
+ return url + '/'
|
| |
+ else:
|
| |
+ return url
|
| |
+
|
| |
+ for key in ['BUGZILLA_URL', 'KOJI_URL', 'BODHI_URL', 'FAS_BASE_URL',
|
| |
+ 'PAGURE_URL', 'PAGURE_API']:
|
| |
+ app.config[key] = end_with_slash(app.config[key])
|
| |
+
|
| |
+ # "Hotfix" for proxy handling on current deployment, my guess is that the proxy
|
| |
+ # server is set differently than it was, but what do I know...
|
| |
if app.config["BEHIND_PROXY"]:
|
| |
from werkzeug.contrib.fixers import ProxyFix
|
| |
app.wsgi_app = ProxyFix(app.wsgi_app, num_proxies=1)
|
| |
This prevents missing slashes or double slashes, depending on what the user
provides in a config file and how the code is written.
I was bothered by double slashed in our tickets, e.g. here:
https://pagure.io/fedora-qa/blocker-review/issue/24