diff --git a/context.go b/context.go index 72f1f5f..d69fc00 100644 --- a/context.go +++ b/context.go @@ -88,6 +88,7 @@ func (c *Context) Reset() { c.m = nil c.realIP = "" c.cod = nil + c.reuseDisabled = false } // RemoteAddr get remote address diff --git a/context_test.go b/context_test.go index 96fc830..09ce453 100644 --- a/context_test.go +++ b/context_test.go @@ -19,14 +19,15 @@ func TestReset(t *testing.T) { Next: func() error { return nil }, - Params: make(map[string]string), - StatusCode: 200, - Body: make(map[string]string), - BodyBuffer: bytes.NewBufferString("abcd"), - RequestBody: []byte("abcd"), - m: make(map[interface{}]interface{}), - realIP: "abcd", - cod: &Cod{}, + Params: make(map[string]string), + StatusCode: 200, + Body: make(map[string]string), + BodyBuffer: bytes.NewBufferString("abcd"), + RequestBody: []byte("abcd"), + m: make(map[interface{}]interface{}), + realIP: "abcd", + cod: &Cod{}, + reuseDisabled: true, } c.Reset() if c.Request != nil || @@ -43,7 +44,8 @@ func TestReset(t *testing.T) { c.RequestBody != nil || c.m != nil || c.realIP != "" || - c.cod != nil { + c.cod != nil || + c.reuseDisabled != false { t.Fatalf("reset fail") } }