1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

minor commit. But I am not happy with the jwt implementations for Go...they seem to produce enough performance cost, will try to make a jwt parser by myself and see the difference

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-10-19 10:05:48 +03:00
parent 02bfc83f2a
commit d517f36a29
5 changed files with 28 additions and 13 deletions

View File

@@ -2130,11 +2130,11 @@ func GetBody(r *http.Request, resetBody bool) ([]byte, error) {
const disableRequestBodyConsumptionContextKey = "iris.request.body.record"
// RecordBody same as the Application's DisableBodyConsumptionOnUnmarshal configuration field
// but acts for the current request.
// RecordRequestBody same as the Application's DisableBodyConsumptionOnUnmarshal
// configuration field but acts only for the current request.
// It makes the request body readable more than once.
func (ctx *Context) RecordBody() {
ctx.values.Set(disableRequestBodyConsumptionContextKey, true)
func (ctx *Context) RecordRequestBody(b bool) {
ctx.values.Set(disableRequestBodyConsumptionContextKey, b)
}
// IsRecordingBody reports whether the request body can be readen multiple times.
@@ -2146,7 +2146,7 @@ func (ctx *Context) IsRecordingBody() bool {
// GetBody reads and returns the request body.
// The default behavior for the http request reader is to consume the data readen
// but you can change that behavior by passing the `WithoutBodyConsumptionOnUnmarshal` Iris option
// or by calling the `RecordBody` method.
// or by calling the `RecordRequestBody` method.
//
// However, whenever you can use the `ctx.Request().Body` instead.
func (ctx *Context) GetBody() ([]byte, error) {