diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..e674a22 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,9 @@ +# These are supported funding model platforms +github: benbusby +ko_fi: benbusby +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/app/routes.py b/app/routes.py index 90b525a..dba4b54 100644 --- a/app/routes.py +++ b/app/routes.py @@ -57,10 +57,12 @@ def before_request_func(): if session['uuid'] not in app.user_elements: app.user_elements.update({session['uuid']: 0}) - # Always redirect to https if HTTPS_ONLY is set (otherwise default to False) + # Handle https upgrade https_only = os.getenv('HTTPS_ONLY', False) + is_heroku = request.url.endswith('.herokuapp.com') + is_http = request.url.startswith('http://') - if https_only and request.url.startswith('http://'): + if (is_heroku and is_http) or (https_only and is_http): return redirect(request.url.replace('http://', 'https://', 1), code=308) g.user_config = Config(**session['config'])