1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-15 01:34:53 +02:00

Flexible handler and middleware

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-03-25 08:50:24 -07:00
parent 99124cda0a
commit e49e74aeac
8 changed files with 138 additions and 86 deletions

View File

@ -17,14 +17,16 @@ type (
}
)
func (r *response) WriteHeader(c int) {
func (r *response) WriteHeader(n int) {
// TODO: fix when halted.
if r.committed {
// TODO: Warning
log.Println("bolt: response already committed")
return
}
r.status = c
r.ResponseWriter.WriteHeader(c)
r.status = n
r.ResponseWriter.WriteHeader(n)
r.committed = true
}