189df128 by astaxie

fix #87

1 parent 8807c327
...@@ -262,15 +262,15 @@ func (c *Controller) GetString(key string) string { ...@@ -262,15 +262,15 @@ func (c *Controller) GetString(key string) string {
262 } 262 }
263 263
264 func (c *Controller) GetStrings(key string) []string { 264 func (c *Controller) GetStrings(key string) []string {
265 r := c.Ctx.Request; 265 r := c.Ctx.Request
266 if r.Form == nil { 266 if r.Form == nil {
267 return []string{} 267 return []string{}
268 } 268 }
269 vs := r.Form[key] 269 vs := r.Form[key]
270 if len(vs) > 0 { 270 if len(vs) > 0 {
271 return vs 271 return vs
272 } 272 }
273 return []string{} 273 return []string{}
274 } 274 }
275 275
276 func (c *Controller) GetInt(key string) (int64, error) { 276 func (c *Controller) GetInt(key string) (int64, error) {
...@@ -327,3 +327,7 @@ func (c *Controller) DelSession(name interface{}) { ...@@ -327,3 +327,7 @@ func (c *Controller) DelSession(name interface{}) {
327 } 327 }
328 c.CruSession.Delete(name) 328 c.CruSession.Delete(name)
329 } 329 }
330
331 func (c *Controller) IsAjax() bool {
332 return (c.Ctx.Request.Header.Get("HTTP_X_REQUESTED_WITH") == "XMLHttpRequest")
333 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!