1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-10 21:45:57 +00:00

fix #1531 and introduce the 'Configuration.ResetOnFireErrorCode' (read HISTORY.md)

Former-commit-id: 84f1e894378a6dfd94e0bf057f4037e35aee0c4f
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-06-08 05:16:55 +03:00
parent 34d0d98130
commit 7bb2223226
20 changed files with 333 additions and 260 deletions

View File

@@ -114,7 +114,7 @@ func (w *ResponseRecorder) SetBodyString(s string) {
w.SetBody([]byte(s))
}
// Body returns the body tracked from the writer so far
// Body returns the body tracked from the writer so far,
// do not use this for edit.
func (w *ResponseRecorder) Body() []byte {
return w.chunks
@@ -190,7 +190,7 @@ func (w *ResponseRecorder) Clone() ResponseWriter {
func (w *ResponseRecorder) WriteTo(res ResponseWriter) {
if to, ok := res.(*ResponseRecorder); ok {
// set the status code, to is first ( probably an error? (context.StatusCodeNotSuccessful, defaults to < 200 || >= 400).
// set the status code, to is first ( probably an error? (context.StatusCodeNotSuccessful, defaults to >=400).
if statusCode := w.ResponseWriter.StatusCode(); statusCode == defaultStatusCode {
to.WriteHeader(statusCode)
}