diff --git a/cookie/cookie.go b/cookie/cookie.go index 3cef98d..13d06bf 100644 --- a/cookie/cookie.go +++ b/cookie/cookie.go @@ -74,6 +74,11 @@ func (c *Cookie) Get(name string) string{ return cookie.Value } +// Returns the map of all the cookies +func (c *Cookie) GetAll() map[string]*http.Cookie { + return c.cookies +} + // An internal function to set all the cookies before pushing response body func (c *Cookie) Finish(){ if c.readonly { @@ -84,4 +89,4 @@ func (c *Cookie) Finish(){ c.response.AddCookie("Set-Cookie", v) } } -} \ No newline at end of file +} diff --git a/request/request.go b/request/request.go index 7d2f6ef..39adedb 100644 --- a/request/request.go +++ b/request/request.go @@ -49,6 +49,7 @@ func (req *Request) Init(request *http.Request, props *map[string]interface{}) * req.Header = make(map[string]string) req.Body = make(map[string][]string) req.Body = request.Form + req.ref = request req.Cookies = &cookie.Cookie{} req.Cookies.InitReadOnly(request) req.Query = make(map[string][]string)