From ebee3aa8b0cb57bbeeea96de7f84b7cdca619442 Mon Sep 17 00:00:00 2001 From: David Bibby Date: Tue, 7 Jul 2020 19:54:51 +0100 Subject: [PATCH] Fix for exception thrown when RAW_BODY is undefined Signed-off-by: David Bibby --- template/python3-flask-armhf/index.py | 2 +- template/python3-flask-debian/index.py | 2 +- template/python3-flask/index.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/template/python3-flask-armhf/index.py b/template/python3-flask-armhf/index.py index 35fa6a8..48554ff 100644 --- a/template/python3-flask-armhf/index.py +++ b/template/python3-flask-armhf/index.py @@ -27,7 +27,7 @@ def fix_transfer_encoding(): @app.route("/", defaults={"path": ""}, methods=["POST", "GET"]) @app.route("/", methods=["POST", "GET"]) def main_route(path): - raw_body = os.getenv("RAW_BODY") + raw_body = os.getenv("RAW_BODY", "false") as_text = True diff --git a/template/python3-flask-debian/index.py b/template/python3-flask-debian/index.py index 35fa6a8..48554ff 100644 --- a/template/python3-flask-debian/index.py +++ b/template/python3-flask-debian/index.py @@ -27,7 +27,7 @@ def fix_transfer_encoding(): @app.route("/", defaults={"path": ""}, methods=["POST", "GET"]) @app.route("/", methods=["POST", "GET"]) def main_route(path): - raw_body = os.getenv("RAW_BODY") + raw_body = os.getenv("RAW_BODY", "false") as_text = True diff --git a/template/python3-flask/index.py b/template/python3-flask/index.py index 35fa6a8..48554ff 100644 --- a/template/python3-flask/index.py +++ b/template/python3-flask/index.py @@ -27,7 +27,7 @@ def fix_transfer_encoding(): @app.route("/", defaults={"path": ""}, methods=["POST", "GET"]) @app.route("/", methods=["POST", "GET"]) def main_route(path): - raw_body = os.getenv("RAW_BODY") + raw_body = os.getenv("RAW_BODY", "false") as_text = True