Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
ff5b09fc
Commit
ff5b09fc
authored
Sep 10, 2015
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
golint context
parent
bdd6a6ae
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
92 deletions
+93
-92
config.go
config.go
+1
-1
context.go
context/context.go
+16
-15
input.go
context/input.go
+24
-24
output.go
context/output.go
+45
-45
controller.go
controller.go
+5
-5
error.go
error.go
+1
-1
router.go
router.go
+1
-1
No files found.
config.go
View file @
ff5b09fc
...
...
@@ -141,7 +141,7 @@ var (
)
type
beegoAppConfig
struct
{
innerConfig
config
.
Config
Contain
er
innerConfig
config
.
Configer
}
func
newAppConfig
(
AppConfigProvider
,
AppConfigPath
string
)
(
*
beegoAppConfig
,
error
)
{
...
...
context/context.go
View file @
ff5b09fc
...
...
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// Package context provide the context utils
// Usage:
//
// import "github.com/astaxie/beego/context"
...
...
@@ -34,14 +35,14 @@ import (
"github.com/astaxie/beego/utils"
)
// Http request context struct including BeegoInput, BeegoOutput, http.Request and http.ResponseWriter.
//
Context
Http request context struct including BeegoInput, BeegoOutput, http.Request and http.ResponseWriter.
// BeegoInput and BeegoOutput provides some api to operate request and response more easily.
type
Context
struct
{
Input
*
BeegoInput
Output
*
BeegoOutput
Request
*
http
.
Request
ResponseWriter
http
.
ResponseWriter
_xsrf
_token
string
_xsrf
Token
string
}
// Redirect does redirection to localurl with http header status code.
...
...
@@ -58,25 +59,25 @@ func (ctx *Context) Abort(status int, body string) {
panic
(
body
)
}
// Write string to response body.
// Write
String Write
string to response body.
// it sends response body.
func
(
ctx
*
Context
)
WriteString
(
content
string
)
{
ctx
.
ResponseWriter
.
Write
([]
byte
(
content
))
}
// Get cookie from request by a given key.
// Get
Cookie Get
cookie from request by a given key.
// It's alias of BeegoInput.Cookie.
func
(
ctx
*
Context
)
GetCookie
(
key
string
)
string
{
return
ctx
.
Input
.
Cookie
(
key
)
}
// Set cookie for response.
// Set
Cookie Set
cookie for response.
// It's alias of BeegoOutput.Cookie.
func
(
ctx
*
Context
)
SetCookie
(
name
string
,
value
string
,
others
...
interface
{})
{
ctx
.
Output
.
Cookie
(
name
,
value
,
others
...
)
}
// Get secure cookie from request by a given key.
// Get
SecureCookie Get
secure cookie from request by a given key.
func
(
ctx
*
Context
)
GetSecureCookie
(
Secret
,
key
string
)
(
string
,
bool
)
{
val
:=
ctx
.
Input
.
Cookie
(
key
)
if
val
==
""
{
...
...
@@ -103,7 +104,7 @@ func (ctx *Context) GetSecureCookie(Secret, key string) (string, bool) {
return
string
(
res
),
true
}
// Set Secure cookie for response.
// Set
SecureCookie Set
Secure cookie for response.
func
(
ctx
*
Context
)
SetSecureCookie
(
Secret
,
name
,
value
string
,
others
...
interface
{})
{
vs
:=
base64
.
URLEncoding
.
EncodeToString
([]
byte
(
value
))
timestamp
:=
strconv
.
FormatInt
(
time
.
Now
()
.
UnixNano
(),
10
)
...
...
@@ -114,23 +115,23 @@ func (ctx *Context) SetSecureCookie(Secret, name, value string, others ...interf
ctx
.
Output
.
Cookie
(
name
,
cookie
,
others
...
)
}
// X
srf
Token creates a xsrf token string and returns.
func
(
ctx
*
Context
)
X
srf
Token
(
key
string
,
expire
int64
)
string
{
if
ctx
.
_xsrf
_t
oken
==
""
{
// X
SRF
Token creates a xsrf token string and returns.
func
(
ctx
*
Context
)
X
SRF
Token
(
key
string
,
expire
int64
)
string
{
if
ctx
.
_xsrf
T
oken
==
""
{
token
,
ok
:=
ctx
.
GetSecureCookie
(
key
,
"_xsrf"
)
if
!
ok
{
token
=
string
(
utils
.
RandomCreateBytes
(
32
))
ctx
.
SetSecureCookie
(
key
,
"_xsrf"
,
token
,
expire
)
}
ctx
.
_xsrf
_t
oken
=
token
ctx
.
_xsrf
T
oken
=
token
}
return
ctx
.
_xsrf
_t
oken
return
ctx
.
_xsrf
T
oken
}
// CheckX
srf
Cookie checks xsrf token in this request is valid or not.
// CheckX
SRF
Cookie checks xsrf token in this request is valid or not.
// the token can provided in request header "X-Xsrftoken" and "X-CsrfToken"
// or in form field value named as "_xsrf".
func
(
ctx
*
Context
)
CheckX
srf
Cookie
()
bool
{
func
(
ctx
*
Context
)
CheckX
SRF
Cookie
()
bool
{
token
:=
ctx
.
Input
.
Query
(
"_xsrf"
)
if
token
==
""
{
token
=
ctx
.
Request
.
Header
.
Get
(
"X-Xsrftoken"
)
...
...
@@ -142,7 +143,7 @@ func (ctx *Context) CheckXsrfCookie() bool {
ctx
.
Abort
(
403
,
"'_xsrf' argument missing from POST"
)
return
false
}
if
ctx
.
_xsrf
_t
oken
!=
token
{
if
ctx
.
_xsrf
T
oken
!=
token
{
ctx
.
Abort
(
403
,
"XSRF cookie does not match POST argument"
)
return
false
}
...
...
context/input.go
View file @
ff5b09fc
...
...
@@ -31,9 +31,9 @@ import (
// Regexes for checking the accept headers
// TODO make sure these are correct
var
(
acceptsH
tml
Regex
=
regexp
.
MustCompile
(
`(text/html|application/xhtml\+xml)(?:,|$)`
)
acceptsX
ml
Regex
=
regexp
.
MustCompile
(
`(application/xml|text/xml)(?:,|$)`
)
acceptsJ
son
Regex
=
regexp
.
MustCompile
(
`(application/json)(?:,|$)`
)
acceptsH
TML
Regex
=
regexp
.
MustCompile
(
`(text/html|application/xhtml\+xml)(?:,|$)`
)
acceptsX
ML
Regex
=
regexp
.
MustCompile
(
`(application/xml|text/xml)(?:,|$)`
)
acceptsJ
SON
Regex
=
regexp
.
MustCompile
(
`(application/json)(?:,|$)`
)
)
// BeegoInput operates the http request header, data, cookie and body.
...
...
@@ -62,13 +62,13 @@ func (input *BeegoInput) Protocol() string {
return
input
.
Request
.
Proto
}
// U
ri
returns full request url with query string, fragment.
func
(
input
*
BeegoInput
)
U
ri
()
string
{
// U
RI
returns full request url with query string, fragment.
func
(
input
*
BeegoInput
)
U
RI
()
string
{
return
input
.
Request
.
RequestURI
}
// U
rl
returns request url path (without query string, fragment).
func
(
input
*
BeegoInput
)
U
rl
()
string
{
// U
RL
returns request url path (without query string, fragment).
func
(
input
*
BeegoInput
)
U
RL
()
string
{
return
input
.
Request
.
URL
.
Path
}
...
...
@@ -117,37 +117,37 @@ func (input *BeegoInput) Is(method string) bool {
return
input
.
Method
()
==
method
}
// Is this a GET method request?
// Is
Get Is
this a GET method request?
func
(
input
*
BeegoInput
)
IsGet
()
bool
{
return
input
.
Is
(
"GET"
)
}
// Is this a POST method request?
// Is
Post Is
this a POST method request?
func
(
input
*
BeegoInput
)
IsPost
()
bool
{
return
input
.
Is
(
"POST"
)
}
// Is this a Head method request?
// Is
Head Is
this a Head method request?
func
(
input
*
BeegoInput
)
IsHead
()
bool
{
return
input
.
Is
(
"HEAD"
)
}
// Is this a OPTIONS method request?
// Is
Options Is
this a OPTIONS method request?
func
(
input
*
BeegoInput
)
IsOptions
()
bool
{
return
input
.
Is
(
"OPTIONS"
)
}
// Is this a PUT method request?
// Is
Put Is
this a PUT method request?
func
(
input
*
BeegoInput
)
IsPut
()
bool
{
return
input
.
Is
(
"PUT"
)
}
// Is this a DELETE method request?
// Is
Delete Is
this a DELETE method request?
func
(
input
*
BeegoInput
)
IsDelete
()
bool
{
return
input
.
Is
(
"DELETE"
)
}
// Is this a PATCH method request?
// Is
Patch Is
this a PATCH method request?
func
(
input
*
BeegoInput
)
IsPatch
()
bool
{
return
input
.
Is
(
"PATCH"
)
}
...
...
@@ -172,19 +172,19 @@ func (input *BeegoInput) IsUpload() bool {
return
strings
.
Contains
(
input
.
Header
(
"Content-Type"
),
"multipart/form-data"
)
}
// Checks if request accepts html response
func
(
input
*
BeegoInput
)
AcceptsH
tml
()
bool
{
return
acceptsH
tml
Regex
.
MatchString
(
input
.
Header
(
"Accept"
))
//
AcceptsHTML
Checks if request accepts html response
func
(
input
*
BeegoInput
)
AcceptsH
TML
()
bool
{
return
acceptsH
TML
Regex
.
MatchString
(
input
.
Header
(
"Accept"
))
}
// Checks if request accepts xml response
func
(
input
*
BeegoInput
)
AcceptsX
ml
()
bool
{
return
acceptsX
ml
Regex
.
MatchString
(
input
.
Header
(
"Accept"
))
//
AcceptsXML
Checks if request accepts xml response
func
(
input
*
BeegoInput
)
AcceptsX
ML
()
bool
{
return
acceptsX
ML
Regex
.
MatchString
(
input
.
Header
(
"Accept"
))
}
// Checks if request accepts json response
func
(
input
*
BeegoInput
)
AcceptsJ
son
()
bool
{
return
acceptsJ
son
Regex
.
MatchString
(
input
.
Header
(
"Accept"
))
//
AcceptsJSON
Checks if request accepts json response
func
(
input
*
BeegoInput
)
AcceptsJ
SON
()
bool
{
return
acceptsJ
SON
Regex
.
MatchString
(
input
.
Header
(
"Accept"
))
}
// IP returns request client ip.
...
...
@@ -314,7 +314,7 @@ func (input *BeegoInput) SetData(key, val interface{}) {
input
.
Data
[
key
]
=
val
}
// parseForm or parseMultiForm based on Content-type
//
ParseFormOrMulitForm
parseForm or parseMultiForm based on Content-type
func
(
input
*
BeegoInput
)
ParseFormOrMulitForm
(
maxMemory
int64
)
error
{
// Parse the body depending on the content type.
if
strings
.
Contains
(
input
.
Header
(
"Content-Type"
),
"multipart/form-data"
)
{
...
...
context/output.go
View file @
ff5b09fc
...
...
@@ -54,7 +54,7 @@ func (output *BeegoOutput) Header(key, val string) {
// if EnableGzip, compress content string.
// it sends out response body directly.
func
(
output
*
BeegoOutput
)
Body
(
content
[]
byte
)
{
output
_w
riter
:=
output
.
Context
.
ResponseWriter
.
(
io
.
Writer
)
output
W
riter
:=
output
.
Context
.
ResponseWriter
.
(
io
.
Writer
)
if
output
.
EnableGzip
==
true
&&
output
.
Context
.
Input
.
Header
(
"Accept-Encoding"
)
!=
""
{
splitted
:=
strings
.
SplitN
(
output
.
Context
.
Input
.
Header
(
"Accept-Encoding"
),
","
,
-
1
)
encodings
:=
make
([]
string
,
len
(
splitted
))
...
...
@@ -65,12 +65,12 @@ func (output *BeegoOutput) Body(content []byte) {
for
_
,
val
:=
range
encodings
{
if
val
==
"gzip"
{
output
.
Header
(
"Content-Encoding"
,
"gzip"
)
output
_w
riter
,
_
=
gzip
.
NewWriterLevel
(
output
.
Context
.
ResponseWriter
,
gzip
.
BestSpeed
)
output
W
riter
,
_
=
gzip
.
NewWriterLevel
(
output
.
Context
.
ResponseWriter
,
gzip
.
BestSpeed
)
break
}
else
if
val
==
"deflate"
{
output
.
Header
(
"Content-Encoding"
,
"deflate"
)
output
_w
riter
,
_
=
flate
.
NewWriter
(
output
.
Context
.
ResponseWriter
,
flate
.
BestSpeed
)
output
W
riter
,
_
=
flate
.
NewWriter
(
output
.
Context
.
ResponseWriter
,
flate
.
BestSpeed
)
break
}
}
...
...
@@ -85,12 +85,12 @@ func (output *BeegoOutput) Body(content []byte) {
output
.
Status
=
0
}
output
_w
riter
.
Write
(
content
)
switch
output
_w
riter
.
(
type
)
{
output
W
riter
.
Write
(
content
)
switch
output
W
riter
.
(
type
)
{
case
*
gzip
.
Writer
:
output
_w
riter
.
(
*
gzip
.
Writer
)
.
Close
()
output
W
riter
.
(
*
gzip
.
Writer
)
.
Close
()
case
*
flate
.
Writer
:
output
_w
riter
.
(
*
flate
.
Writer
)
.
Close
()
output
W
riter
.
(
*
flate
.
Writer
)
.
Close
()
}
}
...
...
@@ -100,29 +100,29 @@ func (output *BeegoOutput) Cookie(name string, value string, others ...interface
var
b
bytes
.
Buffer
fmt
.
Fprintf
(
&
b
,
"%s=%s"
,
sanitizeName
(
name
),
sanitizeValue
(
value
))
//fix cookie not work in IE
if
len
(
others
)
>
0
{
switch
v
:=
others
[
0
]
.
(
type
)
{
case
int
:
if
v
>
0
{
fmt
.
Fprintf
(
&
b
,
"; Expires=%s; Max-Age=%d"
,
time
.
Now
()
.
Add
(
time
.
Duration
(
v
)
*
time
.
Second
)
.
UTC
()
.
Format
(
time
.
RFC1123
),
v
)
}
else
if
v
<
0
{
fmt
.
Fprintf
(
&
b
,
"; Max-Age=0"
)
}
case
int64
:
if
v
>
0
{
fmt
.
Fprintf
(
&
b
,
"; Expires=%s; Max-Age=%d"
,
time
.
Now
()
.
Add
(
time
.
Duration
(
v
)
*
time
.
Second
)
.
UTC
()
.
Format
(
time
.
RFC1123
),
v
)
}
else
if
v
<
0
{
fmt
.
Fprintf
(
&
b
,
"; Max-Age=0"
)
}
case
int32
:
if
v
>
0
{
fmt
.
Fprintf
(
&
b
,
"; Expires=%s; Max-Age=%d"
,
time
.
Now
()
.
Add
(
time
.
Duration
(
v
)
*
time
.
Second
)
.
UTC
()
.
Format
(
time
.
RFC1123
),
v
)
}
else
if
v
<
0
{
fmt
.
Fprintf
(
&
b
,
"; Max-Age=0"
)
}
}
}
//fix cookie not work in IE
if
len
(
others
)
>
0
{
switch
v
:=
others
[
0
]
.
(
type
)
{
case
int
:
if
v
>
0
{
fmt
.
Fprintf
(
&
b
,
"; Expires=%s; Max-Age=%d"
,
time
.
Now
()
.
Add
(
time
.
Duration
(
v
)
*
time
.
Second
)
.
UTC
()
.
Format
(
time
.
RFC1123
),
v
)
}
else
if
v
<
0
{
fmt
.
Fprintf
(
&
b
,
"; Max-Age=0"
)
}
case
int64
:
if
v
>
0
{
fmt
.
Fprintf
(
&
b
,
"; Expires=%s; Max-Age=%d"
,
time
.
Now
()
.
Add
(
time
.
Duration
(
v
)
*
time
.
Second
)
.
UTC
()
.
Format
(
time
.
RFC1123
),
v
)
}
else
if
v
<
0
{
fmt
.
Fprintf
(
&
b
,
"; Max-Age=0"
)
}
case
int32
:
if
v
>
0
{
fmt
.
Fprintf
(
&
b
,
"; Expires=%s; Max-Age=%d"
,
time
.
Now
()
.
Add
(
time
.
Duration
(
v
)
*
time
.
Second
)
.
UTC
()
.
Format
(
time
.
RFC1123
),
v
)
}
else
if
v
<
0
{
fmt
.
Fprintf
(
&
b
,
"; Max-Age=0"
)
}
}
}
// the settings below
// Path, Domain, Secure, HttpOnly
...
...
@@ -188,9 +188,9 @@ func sanitizeValue(v string) string {
return
cookieValueSanitizer
.
Replace
(
v
)
}
// J
son
writes json to response body.
// J
SON
writes json to response body.
// if coding is true, it converts utf-8 to \u0000 type.
func
(
output
*
BeegoOutput
)
J
son
(
data
interface
{},
hasIndent
bool
,
coding
bool
)
error
{
func
(
output
*
BeegoOutput
)
J
SON
(
data
interface
{},
hasIndent
bool
,
coding
bool
)
error
{
output
.
Header
(
"Content-Type"
,
"application/json; charset=utf-8"
)
var
content
[]
byte
var
err
error
...
...
@@ -204,14 +204,14 @@ func (output *BeegoOutput) Json(data interface{}, hasIndent bool, coding bool) e
return
err
}
if
coding
{
content
=
[]
byte
(
stringsToJ
son
(
string
(
content
)))
content
=
[]
byte
(
stringsToJ
SON
(
string
(
content
)))
}
output
.
Body
(
content
)
return
nil
}
// J
sonp
writes jsonp to response body.
func
(
output
*
BeegoOutput
)
J
sonp
(
data
interface
{},
hasIndent
bool
)
error
{
// J
SONP
writes jsonp to response body.
func
(
output
*
BeegoOutput
)
J
SONP
(
data
interface
{},
hasIndent
bool
)
error
{
output
.
Header
(
"Content-Type"
,
"application/javascript; charset=utf-8"
)
var
content
[]
byte
var
err
error
...
...
@@ -228,16 +228,16 @@ func (output *BeegoOutput) Jsonp(data interface{}, hasIndent bool) error {
if
callback
==
""
{
return
errors
.
New
(
`"callback" parameter required`
)
}
callback
_c
ontent
:=
bytes
.
NewBufferString
(
" "
+
template
.
JSEscapeString
(
callback
))
callback
_c
ontent
.
WriteString
(
"("
)
callback
_c
ontent
.
Write
(
content
)
callback
_c
ontent
.
WriteString
(
");
\r\n
"
)
output
.
Body
(
callback
_c
ontent
.
Bytes
())
callback
C
ontent
:=
bytes
.
NewBufferString
(
" "
+
template
.
JSEscapeString
(
callback
))
callback
C
ontent
.
WriteString
(
"("
)
callback
C
ontent
.
Write
(
content
)
callback
C
ontent
.
WriteString
(
");
\r\n
"
)
output
.
Body
(
callback
C
ontent
.
Bytes
())
return
nil
}
// X
ml
writes xml string to response body.
func
(
output
*
BeegoOutput
)
X
ml
(
data
interface
{},
hasIndent
bool
)
error
{
// X
ML
writes xml string to response body.
func
(
output
*
BeegoOutput
)
X
ML
(
data
interface
{},
hasIndent
bool
)
error
{
output
.
Header
(
"Content-Type"
,
"application/xml; charset=utf-8"
)
var
content
[]
byte
var
err
error
...
...
@@ -331,7 +331,7 @@ func (output *BeegoOutput) IsNotFound(status int) bool {
return
output
.
Status
==
404
}
// IsClient returns boolean of this request client sends error data.
// IsClient
Error
returns boolean of this request client sends error data.
// HTTP 4xx means forbidden.
func
(
output
*
BeegoOutput
)
IsClientError
(
status
int
)
bool
{
return
output
.
Status
>=
400
&&
output
.
Status
<
500
...
...
@@ -343,7 +343,7 @@ func (output *BeegoOutput) IsServerError(status int) bool {
return
output
.
Status
>=
500
&&
output
.
Status
<
600
}
func
stringsToJ
son
(
str
string
)
string
{
func
stringsToJ
SON
(
str
string
)
string
{
rs
:=
[]
rune
(
str
)
jsons
:=
""
for
_
,
r
:=
range
rs
{
...
...
@@ -357,7 +357,7 @@ func stringsToJson(str string) string {
return
jsons
}
// Session
s
sets session item value with given key.
// Session sets session item value with given key.
func
(
output
*
BeegoOutput
)
Session
(
name
interface
{},
value
interface
{})
{
output
.
Context
.
Input
.
CruSession
.
Set
(
name
,
value
)
}
controller.go
View file @
ff5b09fc
...
...
@@ -327,7 +327,7 @@ func (c *Controller) ServeJSON(encoding ...bool) {
if
len
(
encoding
)
>
0
&&
encoding
[
0
]
==
true
{
hasencoding
=
true
}
c
.
Ctx
.
Output
.
J
son
(
c
.
Data
[
"json"
],
hasIndent
,
hasencoding
)
c
.
Ctx
.
Output
.
J
SON
(
c
.
Data
[
"json"
],
hasIndent
,
hasencoding
)
}
// ServeJSONP sends a jsonp response.
...
...
@@ -338,7 +338,7 @@ func (c *Controller) ServeJSONP() {
}
else
{
hasIndent
=
true
}
c
.
Ctx
.
Output
.
J
sonp
(
c
.
Data
[
"jsonp"
],
hasIndent
)
c
.
Ctx
.
Output
.
J
SONP
(
c
.
Data
[
"jsonp"
],
hasIndent
)
}
// ServeXML sends xml response.
...
...
@@ -349,7 +349,7 @@ func (c *Controller) ServeXML() {
}
else
{
hasIndent
=
true
}
c
.
Ctx
.
Output
.
X
ml
(
c
.
Data
[
"xml"
],
hasIndent
)
c
.
Ctx
.
Output
.
X
ML
(
c
.
Data
[
"xml"
],
hasIndent
)
}
// ServeFormatted serve Xml OR Json, depending on the value of the Accept header
...
...
@@ -630,7 +630,7 @@ func (c *Controller) XSRFToken() string {
}
else
{
expire
=
int64
(
XSRFExpire
)
}
c
.
_xsrfToken
=
c
.
Ctx
.
X
srf
Token
(
XSRFKEY
,
expire
)
c
.
_xsrfToken
=
c
.
Ctx
.
X
SRF
Token
(
XSRFKEY
,
expire
)
}
return
c
.
_xsrfToken
}
...
...
@@ -642,7 +642,7 @@ func (c *Controller) CheckXSRFCookie() bool {
if
!
c
.
EnableXSRF
{
return
true
}
return
c
.
Ctx
.
CheckX
srf
Cookie
()
return
c
.
Ctx
.
CheckX
SRF
Cookie
()
}
// XSRFFormHTML writes an input field contains xsrf token value.
...
...
error.go
View file @
ff5b09fc
...
...
@@ -87,7 +87,7 @@ func showErr(err interface{}, ctx *context.Context, Stack string) {
data
:=
make
(
map
[
string
]
string
)
data
[
"AppError"
]
=
AppName
+
":"
+
fmt
.
Sprint
(
err
)
data
[
"RequestMethod"
]
=
ctx
.
Input
.
Method
()
data
[
"RequestURL"
]
=
ctx
.
Input
.
U
ri
()
data
[
"RequestURL"
]
=
ctx
.
Input
.
U
RI
()
data
[
"RemoteAddr"
]
=
ctx
.
Input
.
IP
()
data
[
"Stack"
]
=
Stack
data
[
"BeegoVersion"
]
=
VERSION
...
...
router.go
View file @
ff5b09fc
...
...
@@ -875,7 +875,7 @@ func (p *ControllerRegister) recoverPanic(context *beecontext.Context) {
}
}
var
stack
string
Critical
(
"the request url is "
,
context
.
Input
.
U
rl
())
Critical
(
"the request url is "
,
context
.
Input
.
U
RL
())
Critical
(
"Handler crashed with error"
,
err
)
for
i
:=
1
;
;
i
++
{
_
,
file
,
line
,
ok
:=
runtime
.
Caller
(
i
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment