Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
e01fbd49
authored
2013-12-18 20:53:23 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
when call abort show the err:http: multiple response.WriteHeader calls
1 parent
9edf3143
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
middleware/error.go
router.go
middleware/error.go
View file @
e01fbd4
...
...
@@ -194,7 +194,7 @@ func NotFound(rw http.ResponseWriter, r *http.Request) {
"<br>You like 404 pages"
+
"</ul>"
)
data
[
"BeegoVersion"
]
=
VERSION
rw
.
WriteHeader
(
http
.
StatusNotFound
)
//
rw.WriteHeader(http.StatusNotFound)
t
.
Execute
(
rw
,
data
)
}
...
...
@@ -210,7 +210,7 @@ func Unauthorized(rw http.ResponseWriter, r *http.Request) {
"<br>Check the address for errors"
+
"</ul>"
)
data
[
"BeegoVersion"
]
=
VERSION
rw
.
WriteHeader
(
http
.
StatusUnauthorized
)
//
rw.WriteHeader(http.StatusUnauthorized)
t
.
Execute
(
rw
,
data
)
}
...
...
@@ -227,7 +227,7 @@ func Forbidden(rw http.ResponseWriter, r *http.Request) {
"<br>You need to log in"
+
"</ul>"
)
data
[
"BeegoVersion"
]
=
VERSION
rw
.
WriteHeader
(
http
.
StatusForbidden
)
//
rw.WriteHeader(http.StatusForbidden)
t
.
Execute
(
rw
,
data
)
}
...
...
@@ -243,7 +243,7 @@ func ServiceUnavailable(rw http.ResponseWriter, r *http.Request) {
"<br>Please try again later."
+
"</ul>"
)
data
[
"BeegoVersion"
]
=
VERSION
rw
.
WriteHeader
(
http
.
StatusServiceUnavailable
)
//
rw.WriteHeader(http.StatusServiceUnavailable)
t
.
Execute
(
rw
,
data
)
}
...
...
@@ -258,7 +258,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
)
//
rw.WriteHeader(http.StatusInternalServerError)
t
.
Execute
(
rw
,
data
)
}
...
...
router.go
View file @
e01fbd4
...
...
@@ -406,6 +406,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
if
ErrorsShow
{
handler
:=
p
.
getErrorHandler
(
fmt
.
Sprint
(
err
))
handler
(
rw
,
r
)
return
}
else
{
Critical
(
"Handler crashed with error"
,
err
)
for
i
:=
1
;
;
i
++
{
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment