added IsAjax and RemoteAddr for context, gofmt #15

Merged
lunny merged 2 commits from fuxiaohei/master into master 2015-10-26 05:49:29 +00:00
Showing only changes of commit 70bfc05b5c - Show all commits

View File

@ -87,7 +87,7 @@ func (ctx *Context) Params() *Params {
return &ctx.params
}
func (ctx *Context) RemoteAddr() string {
func (ctx *Context) IP() string {
proxy := []string{}
if ips := ctx.Req().Header.Get("X-Forwarded-For"); ips != "" {
proxy = strings.Split(ips, ",")