Skip to content

Commit

Permalink
this fix "the POST data secret is blank when it is running on altlab-…
Browse files Browse the repository at this point in the history
…gw . But it works very well locally"openfaas/python-flask-template#5
  • Loading branch information
anAntelope committed Nov 30, 2020
1 parent 9de091f commit 55f6c0d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ def get_secret() -> str:
return secret_content


@app.before_request
def fix_transfer_encoding():
"""
Sets the "wsgi.input_terminated" environment flag, thus enabling
Werkzeug to pass chunked requests as streams. The gunicorn server
should set this, but it's not yet been implemented.
"""

transfer_encoding = request.headers.get("Transfer-Encoding", None)
if transfer_encoding == u"chunked":
request.environ["wsgi.input_terminated"] = True


@app.route('/')
def hello_world():
return "deploy.altlab.dev is running!"
Expand Down

0 comments on commit 55f6c0d

Please sign in to comment.