Skip to content
Snippets Groups Projects
Commit f09c5b5e authored by Julian's avatar Julian
Browse files

Disabled exceptions for non-HTTPS

parent edb71f26
No related branches found
No related tags found
No related merge requests found
Pipeline #669 passed
...@@ -13,6 +13,8 @@ def create_app(test_config=None): ...@@ -13,6 +13,8 @@ def create_app(test_config=None):
app.config.from_pyfile('config.py', silent=True) app.config.from_pyfile('config.py', silent=True)
else: else:
app.config.from_mapping(test_config) app.config.from_mapping(test_config)
# oauthlib enforces the OAuth2.0 requirement to use HTTPS, when this is not set
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # That behaviour sucks, so disable it
@app.route("/auth") @app.route("/auth")
def auth(): def auth():
...@@ -87,7 +89,5 @@ a valid redirect_uri for the client_id. ...@@ -87,7 +89,5 @@ a valid redirect_uri for the client_id.
return app return app
if __name__ == '__main__': if __name__ == '__main__':
# oauthlib enforces the OAuth2.0 requirement to use HTTPS, when this is not set
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Don't do that in production!
testapp = create_app() testapp = create_app()
testapp.run(debug=True, host='localhost', port=5002) testapp.run(debug=True, host='localhost', port=5002)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment