changeset 84813f41d70a in www.tryton.org:default
details: https://hg.tryton.org/www.tryton.org?cmd=changeset;node=84813f41d70a
description:
        Force https scheme for canonical only if not debug mode
diffstat:

 app.py |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 9b09211bd34f -r 84813f41d70a app.py
--- a/app.py    Sun Jan 12 16:22:45 2020 +0100
+++ b/app.py    Sun Jan 12 16:24:51 2020 +0100
@@ -209,7 +209,8 @@
         endpoint = request.endpoint
     if not endpoint:
         return ''
-    return url_for(endpoint, _external=True, _scheme='https', **values)
+    scheme = 'https' if not app.debug else None
+    return url_for(endpoint, _external=True, _scheme=scheme, **values)
 
 
 @app.context_processor

Reply via email to