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

context transactions removed and make Context.Domain customizable as requested

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-06-05 06:15:10 +03:00
parent c6911851f1
commit d8af2a1e14
8 changed files with 28 additions and 313 deletions

View File

@@ -29,17 +29,14 @@ func releaseResponseRecorder(w *ResponseRecorder) {
rrpool.Put(w)
}
// A ResponseRecorder is used mostly by context's transactions
// in order to record and change if needed the body, status code and headers.
// A ResponseRecorder is used mostly for testing
// in order to record and modify, if necessary, the body and status code and headers.
//
// Developers are not limited to manually ask to record a response.
// To turn on the recorder from a Handler,
// rec := context.Recorder()
// See `context.Recorder`` method too.
type ResponseRecorder struct {
ResponseWriter
// keep track of the body in order to be
// resetable and useful inside custom transactions
// keep track of the body written.
chunks []byte
// the saved headers
headers http.Header