openfaas / of-watchdog

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

Support streaming multipart/formdata with of-watchdog #44

Open dschulten opened 5 years ago

dschulten commented 5 years ago

Expected Behaviour

It should be possible to post a multipart request to the watchdog and work with the parts in such a way that Content-Disposition header information (such as the filename) is available to the function.

If there is only one part, feed it to stdin.

If possible, allow to access multiple parts by their names as stream, too.

Make content-disposition information available to the function similar to the usual request headers. (The Content-Disposition header is defined as a response header only, but it may occur in multipart/formdata for requests).

Current Behaviour

There is no special support for multipart requests.

Possible Solution

-

Context

The related issue https://github.com/openfaas/faas/issues/344 asked for multipart support by means of a json object containing all base64 encoded parts, that might not be ideal in terms of memory requirements for big multipart requests. In https://github.com/openfaas/faas/issues/345 it was concluded that support for multipart should go into of-watchdog

dschulten commented 5 years ago

See https://github.com/openfaas-incubator/python-flask-template/issues/18 for a possible solution