mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
add headers right way, more docs
This commit is contained in:
@@ -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 ?
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user