1
0
mirror of https://github.com/kataras/iris.git synced 2026-03-05 16:05:58 +00:00

accesslog: log error bodies and communicate with the recover middleware

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-09-10 14:47:14 +03:00
parent cf0338d342
commit ae67987f55
7 changed files with 142 additions and 15 deletions

View File

@@ -609,6 +609,7 @@ New Package-level Variables:
New Context Methods:
- `Context.IsRecovered()` reports whether the current request was recovered from the [recover middleware](https://github.com/kataras/iris/tree/master/middleware/recover). Also the `iris.IsErrPrivate` function and `iris.ErrPrivate` interface have been introduced.
- `Context.RecordBody()` same as the Application's `DisableBodyConsumptionOnUnmarshal` configuration field but registers per chain of handlers. It makes the request body readable more than once.
- `Context.IsRecordingBody() bool` reports whether the request body can be readen multiple times.
- `Context.ReadHeaders(ptr interface{}) error` binds request headers to "ptr". [Example](https://github.com/kataras/iris/blob/master/_examples/request-body/read-headers/main.go).