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
ec7324e9
Commit
ec7324e9
authored
Jul 18, 2013
by
astaxie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #98 from Unknwon/master
Fixed bug: error page cannot show correct corresponding status code
parents
7f4ad7ff
7f5dd134
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
errors.go
errors.go
+5
-0
router.go
router.go
+1
-0
No files found.
errors.go
View file @
ec7324e9
...
...
@@ -189,6 +189,7 @@ func NotFound(rw http.ResponseWriter, r *http.Request) {
"<br>You like 404 pages"
+
"</ul>"
)
data
[
"BeegoVersion"
]
=
VERSION
rw
.
WriteHeader
(
http
.
StatusNotFound
)
t
.
Execute
(
rw
,
data
)
}
...
...
@@ -204,6 +205,7 @@ func Unauthorized(rw http.ResponseWriter, r *http.Request) {
"<br>Check the address for errors"
+
"</ul>"
)
data
[
"BeegoVersion"
]
=
VERSION
rw
.
WriteHeader
(
http
.
StatusUnauthorized
)
t
.
Execute
(
rw
,
data
)
}
...
...
@@ -220,6 +222,7 @@ func Forbidden(rw http.ResponseWriter, r *http.Request) {
"<br>You need to log in"
+
"</ul>"
)
data
[
"BeegoVersion"
]
=
VERSION
rw
.
WriteHeader
(
http
.
StatusForbidden
)
t
.
Execute
(
rw
,
data
)
}
...
...
@@ -235,6 +238,7 @@ func ServiceUnavailable(rw http.ResponseWriter, r *http.Request) {
"<br>Please try again later."
+
"</ul>"
)
data
[
"BeegoVersion"
]
=
VERSION
rw
.
WriteHeader
(
http
.
StatusServiceUnavailable
)
t
.
Execute
(
rw
,
data
)
}
...
...
@@ -249,6 +253,7 @@ func InternalServerError(rw http.ResponseWriter, r *http.Request) {
"<br>you should report the fault to the website administrator"
+
"</ul>"
)
data
[
"BeegoVersion"
]
=
VERSION
rw
.
WriteHeader
(
http
.
StatusInternalServerError
)
t
.
Execute
(
rw
,
data
)
}
...
...
router.go
View file @
ec7324e9
...
...
@@ -445,6 +445,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
//if no matches to url, throw a not found exception
if
!
findrouter
{
if
h
,
ok
:=
ErrorMaps
[
"404"
];
ok
{
w
.
status
=
404
h
(
w
,
r
)
}
else
{
http
.
NotFound
(
w
,
r
)
...
...
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