From ea93ba00ac67da3544759583e9f65d5c3249885c Mon Sep 17 00:00:00 2001 From: Pedro Nasser Date: Tue, 13 Dec 2016 23:55:32 -0200 Subject: [PATCH] Disable envAsHeader by default (#435) * disable envAsHeader by default * fix -e flag usage description --- fn/routes.go | 4 +++- fn/run.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fn/routes.go b/fn/routes.go index b788412d1..88abd2a40 100644 --- a/fn/routes.go +++ b/fn/routes.go @@ -237,7 +237,9 @@ func callfn(u string, content io.Reader, output io.Writer, env []string) error { req.Header.Set("Content-Type", "application/json") - envAsHeader(req, env) + if len(env) > 0 { + envAsHeader(req, env) + } resp, err := http.DefaultClient.Do(req) if err != nil { diff --git a/fn/run.go b/fn/run.go index 401140c10..54092815b 100644 --- a/fn/run.go +++ b/fn/run.go @@ -29,7 +29,7 @@ func runflags() []cli.Flag { return []cli.Flag{ cli.StringSliceFlag{ Name: "e", - Usage: "limit the environment variables sent to function, if ommited then all are sent.", + Usage: "select environment variables to be sent to function", }, } }