Browse Source

Updated: add cookie process.

v0.6 v0.5.4
Mingcai SHEN 5 years ago
parent
commit
2a658f2d6c
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      restlet/types.go

+ 5
- 0
restlet/types.go View File

@ -165,6 +165,11 @@ func (f RestletFunc) Handle(ctx RequestContext, w http.ResponseWriter, r *http.R
if ret.DataOnly { if ret.DataOnly {
data = ret.Data data = ret.Data
} }
if len(ret.Cookies) > 0 {
for _, c := range ret.Cookies {
http.SetCookie(w, c)
}
}
switch strings.ToLower(format) { switch strings.ToLower(format) {
case "xml": case "xml":
XmlReponse(data, retCode, w) XmlReponse(data, retCode, w)

Loading…
Cancel
Save