mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Removes FN_PARAM_xxx (#661)
This commit is contained in:
committed by
Owen Cliffe
parent
66cdd2aca5
commit
580dd3e5cb
@@ -178,11 +178,6 @@ func TestCallConfigurationRequest(t *testing.T) {
|
|||||||
expectedEnv["FN_METHOD"] = method
|
expectedEnv["FN_METHOD"] = method
|
||||||
expectedEnv["FN_REQUEST_URL"] = url
|
expectedEnv["FN_REQUEST_URL"] = url
|
||||||
|
|
||||||
// add expected parameters from URL
|
|
||||||
for _, val := range params {
|
|
||||||
expectedEnv[fmt.Sprintf("FN_PARAM_%s", val.Key)] = val.Value
|
|
||||||
}
|
|
||||||
|
|
||||||
// do this before the "real" headers get sucked in cuz they are formatted differently
|
// do this before the "real" headers get sucked in cuz they are formatted differently
|
||||||
expectedHeaders := make(http.Header)
|
expectedHeaders := make(http.Header)
|
||||||
for k, v := range expectedEnv {
|
for k, v := range expectedEnv {
|
||||||
|
|||||||
@@ -113,11 +113,6 @@ func FromRequest(appName, path string, req *http.Request, params Params) CallOpt
|
|||||||
envVars["FN_METHOD"] = req.Method
|
envVars["FN_METHOD"] = req.Method
|
||||||
envVars["FN_REQUEST_URL"] = url
|
envVars["FN_REQUEST_URL"] = url
|
||||||
|
|
||||||
// params
|
|
||||||
for _, param := range params {
|
|
||||||
envVars[toEnvName("FN_PARAM", param.Key)] = param.Value
|
|
||||||
}
|
|
||||||
|
|
||||||
headerVars := make(map[string]string, len(req.Header))
|
headerVars := make(map[string]string, len(req.Header))
|
||||||
|
|
||||||
for k, v := range req.Header {
|
for k, v := range req.Header {
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ You will also have access to a set of environment variables.
|
|||||||
* `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.
|
* `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://github.com/fnproject/cli/blob/master/README.md#application-level-configuration) you've set
|
* `$X` - any [configuration values](https://github.com/fnproject/cli/blob/master/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.
|
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.
|
Warning: these may change before release.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user