diff --git a/mittwaldv2/client.go b/mittwaldv2/client.go index 32bfa39..62880de 100644 --- a/mittwaldv2/client.go +++ b/mittwaldv2/client.go @@ -22,9 +22,12 @@ func New(ctx context.Context, opts ...ClientOption) (generatedv2.Client, error) var runner httpclient.RequestRunner = http.DefaultClient var err error + // caution, this is counter-intuitive: since the options are basically a chain of wrappers around the actual + // request runner, they run inside-out and the options added _last_ will be applied _first_. This is why the default + // options need to come last. allOpts := append( - defaultOpts[:], - opts..., + opts, + defaultOpts[:]..., ) for _, o := range allOpts {