From cfdca829382b83081a897ae36c4196678b52a9b4 Mon Sep 17 00:00:00 2001 From: Vladimir Kochnev Date: Fri, 26 Aug 2022 03:24:40 +0300 Subject: Mark some of the option fields as ignored in pkg/bindings I realized that `params.Del("SkipTLSVerify")` doesn't have any effect because keys are always lowercased. So it should really be `params.Del("skiptlsverify")`. There's also a little bug introduced by 3bf52aa and b1d1248: if one passes `ProgressWriter` object having `Stringer` interface i.e. `bytes.Buffer` it ends up been serialized in query with `util.ToParams()`. To circumvent both problems I propose to mark non-serializable parameters with `schema:"-"` so there's no need to delete them from resulting `url.Values`. Signed-off-by: Vladimir Kochnev --- pkg/bindings/internal/util/util.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/bindings/internal') diff --git a/pkg/bindings/internal/util/util.go b/pkg/bindings/internal/util/util.go index f8f99d6c1..52ce14738 100644 --- a/pkg/bindings/internal/util/util.go +++ b/pkg/bindings/internal/util/util.go @@ -74,6 +74,9 @@ func ToParams(o interface{}) (url.Values, error) { } paramName := fieldName if pn, ok := sType.Field(i).Tag.Lookup("schema"); ok { + if pn == "-" { + continue + } paramName = pn } switch { -- cgit v1.2.3-54-g00ecf