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
76522d43
Commit
76522d43
authored
Nov 04, 2014
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simple the session
parent
52df1234
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
router.go
router.go
+12
-1
No files found.
router.go
View file @
76522d43
...
...
@@ -644,7 +644,13 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
// session init
if
SessionOn
{
context
.
Input
.
CruSession
=
GlobalSessions
.
SessionStart
(
w
,
r
)
var
err
error
context
.
Input
.
CruSession
,
err
=
GlobalSessions
.
SessionStart
(
w
,
r
)
if
err
!=
nil
{
Error
(
err
)
middleware
.
Exception
(
"503"
,
rw
,
r
,
""
)
return
}
defer
func
()
{
context
.
Input
.
CruSession
.
SessionRelease
(
w
)
}()
...
...
@@ -888,6 +894,11 @@ func (p *ControllerRegistor) recoverPanic(rw http.ResponseWriter, r *http.Reques
if
handler
,
ok
:=
middleware
.
ErrorMaps
[
fmt
.
Sprint
(
err
)];
ok
{
handler
(
rw
,
r
)
return
}
else
if
handler
,
ok
:=
middleware
.
ErrorMaps
[
"503"
];
ok
{
handler
(
rw
,
r
)
return
}
else
{
rw
.
Write
([]
byte
(
fmt
.
Sprint
(
err
)))
}
}
else
{
Critical
(
"the request url is "
,
r
.
URL
.
Path
)
...
...
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