rename package name & fix bug
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
// Package context provide the context utils
|
||||
// Usage:
|
||||
//
|
||||
// import "github.com/astaxie/beego/context"
|
||||
// import "github.com/beego/beego/context"
|
||||
//
|
||||
// ctx := context.Context{Request:req,ResponseWriter:rw}
|
||||
//
|
||||
@@ -35,7 +35,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/utils"
|
||||
"github.com/beego/beego/utils"
|
||||
)
|
||||
|
||||
//commonly used mime-types
|
||||
@@ -147,7 +147,7 @@ func (ctx *Context) SetSecureCookie(Secret, name, value string, others ...interf
|
||||
// XSRFToken creates a xsrf token string and returns.
|
||||
// others[0] bool secure
|
||||
// others[1] bool http-only
|
||||
func (ctx *Context) XSRFToken(key string, expire int64, others...interface{}) string {
|
||||
func (ctx *Context) XSRFToken(key string, expire int64, others ...interface{}) string {
|
||||
if ctx._xsrfToken == "" {
|
||||
token, ok := ctx.GetSecureCookie(key, "_xsrf")
|
||||
if !ok {
|
||||
@@ -157,7 +157,7 @@ func (ctx *Context) XSRFToken(key string, expire int64, others...interface{}) st
|
||||
secure = others[0].(bool)
|
||||
}
|
||||
httpOnly := false
|
||||
if len(others) > 1{
|
||||
if len(others) > 1 {
|
||||
httpOnly = others[1].(bool)
|
||||
}
|
||||
ctx.SetSecureCookie(key, "_xsrf", token, expire, "", "", secure, httpOnly)
|
||||
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/astaxie/beego/session"
|
||||
"github.com/beego/beego/session"
|
||||
)
|
||||
|
||||
// Regexes for checking the accept headers
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
beecontext "github.com/astaxie/beego/context"
|
||||
"github.com/astaxie/beego/logs"
|
||||
beecontext "github.com/beego/beego/context"
|
||||
"github.com/beego/beego/logs"
|
||||
)
|
||||
|
||||
// ConvertParams converts http method params to values that will be passed to the method controller as arguments
|
||||
|
||||
Reference in New Issue
Block a user