Skip to content

Commit 55f6c0d

Browse files
committed
this fix "the POST data secret is blank when it is running on altlab-gw . But it works very well locally"openfaas/python-flask-template#5
1 parent 9de091f commit 55f6c0d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

app/app.py

+13
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ def get_secret() -> str:
6464
return secret_content
6565

6666

67+
@app.before_request
68+
def fix_transfer_encoding():
69+
"""
70+
Sets the "wsgi.input_terminated" environment flag, thus enabling
71+
Werkzeug to pass chunked requests as streams. The gunicorn server
72+
should set this, but it's not yet been implemented.
73+
"""
74+
75+
transfer_encoding = request.headers.get("Transfer-Encoding", None)
76+
if transfer_encoding == u"chunked":
77+
request.environ["wsgi.input_terminated"] = True
78+
79+
6780
@app.route('/')
6881
def hello_world():
6982
return "deploy.altlab.dev is running!"

0 commit comments

Comments
 (0)