Closed alexellis closed 4 years ago
I'll take this one.
Reading lines 156-169 in main.go, it seems there are five modes, streaming, serializing, afterburn, requestHandler, http, and static.
The instructions don't seem to align, so I need to do some more research into the modes and why they would or would not need the http_Transfer_Encoding env-var.
The first sentence says, "Add Http_Transfer_Encoding env-var to all modes but http," which to me sounds like I should modify streaming, serializing, afterburn, requestHandler, and static.
The last part of the second sentence says, "...should be added here for the streaming and forking modes." Which to me means to modify the streaming mode, and whichever is the synonym for the forking mode.
I'll read more about Transfer Encoding and the various WatchDog modes tomorrow after work.
I think I might have given you the impression that this is more complicated than it is, sorry for that.
It's simply a copy/paste job and no more than that. Copy the code from the classic watchdog into the handlers for the forking / streaming modes. I think we renamed forking to "serializing".
https://github.com/openfaas-incubator/of-watchdog/blob/master/executor/streaming_runner.go#L38 https://github.com/openfaas-incubator/of-watchdog/blob/master/executor/serializing_fork_runner.go#L46
In both places, simply copy/paste the code that populates req.Environment
. That's it.
https://github.com/openfaas-incubator/of-watchdog/blob/master/main.go#L244 https://github.com/openfaas-incubator/of-watchdog/blob/master/main.go#L275
I'll take this as it's probably easier that way. Take a look at the commit above.
Add Http_Transfer_Encoding env-var to all modes but http. It was added to the classic watchdog and should be added here for the streaming and forking modes.
Possible solution
Copy the design from https://github.com/openfaas/faas/pull/1423