From eb22309aec9fdfc8592512b3cbe3ba52c11652bf Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Sun, 17 Feb 2019 16:10:25 +0200 Subject: [PATCH] fix issue on binding sessions caused by variadic cookie options, as reported at: https://github.com/kataras/iris/issues/1197 Former-commit-id: 595a347706b6816729939a2e9d9098f5d3f72304 --- hero/di.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hero/di.go b/hero/di.go index d5066514..d997e114 100644 --- a/hero/di.go +++ b/hero/di.go @@ -36,7 +36,8 @@ func init() { } di.DefaultTypeChecker = func(fn reflect.Type) bool { - // valid if that single input arg is a typeof context.Context. - return fn.NumIn() == 1 && IsContext(fn.In(0)) + // valid if that single input arg is a typeof context.Context + // or first argument is context.Context and second argument is a variadic, which is ignored (i.e new sessions#Start). + return (fn.NumIn() == 1 || (fn.NumIn() == 2 && fn.IsVariadic())) && IsContext(fn.In(0)) } }