openfaas / of-watchdog

Reverse proxy for STDIO and HTTP microservices
MIT License
259 stars 115 forks source link

Override to disable chunked encoding in HTTP mode #39

Closed alexellis closed 5 years ago

alexellis commented 5 years ago

Expected Behaviour

We could offer an env-var override to disable chunked encoding in HTTP mode. The side-effect is that we would have to cache the request in memory before proxying it to the upstream_url - but this also adds greater compatibility with frameworks like PHP Swoole.

Current Behaviour

PHP Swoole for instance cannot support transfer-encoding of chunked.

Possible Solution

If an env-var is set then buffer the response to gauge the length and then forward on to the upstream_url.

Steps to Reproduce (for bugs)

  1. Try to do a POST to a function using this template -> https://github.com/alexellis/php7-swoole-template
  2. Then exec into the function and do a post with an explicit content-length set (not chunked) and it will work