diff --git a/api/agent/protocol/http.go b/api/agent/protocol/http.go index a273c85c6..2291ece8d 100644 --- a/api/agent/protocol/http.go +++ b/api/agent/protocol/http.go @@ -41,8 +41,10 @@ func (h *HTTPProtocol) Dispatch(w io.Writer, req *http.Request) error { return err } - for k, v := range res.Header { - rw.Header().Add(k, v) // on top of any specified on the route + for k, vs := range res.Header { + for _, v := range vs { + rw.Header().Add(k, v) // on top of any specified on the route + } } rw.WriteHeader(res.StatusCode) // TODO should we TCP_CORK ? diff --git a/docs/writing.md b/docs/writing.md index dbbfa362b..134ec4dcf 100644 --- a/docs/writing.md +++ b/docs/writing.md @@ -38,9 +38,11 @@ You will also have access to a set of environment variables. * `FN_CALL_ID` - a unique ID for each function execution. * `FN_FORMAT` - a string representing one of the [function formats](function-format.md), currently either `default` or `http`. Default is `default`. * `FN_MEMORY` - a number representing the amount of memory available to the call, in MB +* `FN_TYPE` - the type for this call, currently 'sync' or 'async' * `FN_HEADER_$X` - the HTTP headers that were set for this request. Replace $X with the upper cased name of the header and replace dashes in the header with underscores. * `$X` - any [configuration values](https://gitlab.oracledx.com/odx/functions/blob/master/fn/README.md#application-level-configuration) you've set for the Application or the Route. Replace X with the upper cased name of the config variable you set. Ex: `minio_secret=secret` will be exposed via MINIO_SECRET env var. +* `FN_PARAM_$Y` - any variables found from parsing the URL. Replace $Y with any `:var` from the url. Warning: these may change before release.