e01fbd49 by astaxie

when call abort show the err:http: multiple response.WriteHeader calls

1 parent 9edf3143
...@@ -194,7 +194,7 @@ func NotFound(rw http.ResponseWriter, r *http.Request) { ...@@ -194,7 +194,7 @@ func NotFound(rw http.ResponseWriter, r *http.Request) {
194 "<br>You like 404 pages" + 194 "<br>You like 404 pages" +
195 "</ul>") 195 "</ul>")
196 data["BeegoVersion"] = VERSION 196 data["BeegoVersion"] = VERSION
197 rw.WriteHeader(http.StatusNotFound) 197 //rw.WriteHeader(http.StatusNotFound)
198 t.Execute(rw, data) 198 t.Execute(rw, data)
199 } 199 }
200 200
...@@ -210,7 +210,7 @@ func Unauthorized(rw http.ResponseWriter, r *http.Request) { ...@@ -210,7 +210,7 @@ func Unauthorized(rw http.ResponseWriter, r *http.Request) {
210 "<br>Check the address for errors" + 210 "<br>Check the address for errors" +
211 "</ul>") 211 "</ul>")
212 data["BeegoVersion"] = VERSION 212 data["BeegoVersion"] = VERSION
213 rw.WriteHeader(http.StatusUnauthorized) 213 //rw.WriteHeader(http.StatusUnauthorized)
214 t.Execute(rw, data) 214 t.Execute(rw, data)
215 } 215 }
216 216
...@@ -227,7 +227,7 @@ func Forbidden(rw http.ResponseWriter, r *http.Request) { ...@@ -227,7 +227,7 @@ func Forbidden(rw http.ResponseWriter, r *http.Request) {
227 "<br>You need to log in" + 227 "<br>You need to log in" +
228 "</ul>") 228 "</ul>")
229 data["BeegoVersion"] = VERSION 229 data["BeegoVersion"] = VERSION
230 rw.WriteHeader(http.StatusForbidden) 230 //rw.WriteHeader(http.StatusForbidden)
231 t.Execute(rw, data) 231 t.Execute(rw, data)
232 } 232 }
233 233
...@@ -243,7 +243,7 @@ func ServiceUnavailable(rw http.ResponseWriter, r *http.Request) { ...@@ -243,7 +243,7 @@ func ServiceUnavailable(rw http.ResponseWriter, r *http.Request) {
243 "<br>Please try again later." + 243 "<br>Please try again later." +
244 "</ul>") 244 "</ul>")
245 data["BeegoVersion"] = VERSION 245 data["BeegoVersion"] = VERSION
246 rw.WriteHeader(http.StatusServiceUnavailable) 246 //rw.WriteHeader(http.StatusServiceUnavailable)
247 t.Execute(rw, data) 247 t.Execute(rw, data)
248 } 248 }
249 249
...@@ -258,7 +258,7 @@ func InternalServerError(rw http.ResponseWriter, r *http.Request) { ...@@ -258,7 +258,7 @@ func InternalServerError(rw http.ResponseWriter, r *http.Request) {
258 "<br>you should report the fault to the website administrator" + 258 "<br>you should report the fault to the website administrator" +
259 "</ul>") 259 "</ul>")
260 data["BeegoVersion"] = VERSION 260 data["BeegoVersion"] = VERSION
261 rw.WriteHeader(http.StatusInternalServerError) 261 //rw.WriteHeader(http.StatusInternalServerError)
262 t.Execute(rw, data) 262 t.Execute(rw, data)
263 } 263 }
264 264
......
...@@ -406,6 +406,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -406,6 +406,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
406 if ErrorsShow { 406 if ErrorsShow {
407 handler := p.getErrorHandler(fmt.Sprint(err)) 407 handler := p.getErrorHandler(fmt.Sprint(err))
408 handler(rw, r) 408 handler(rw, r)
409 return
409 } else { 410 } else {
410 Critical("Handler crashed with error", err) 411 Critical("Handler crashed with error", err)
411 for i := 1; ; i++ { 412 for i := 1; ; i++ {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!