mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 10:41:03 +01:00
minor
Former-commit-id: ee1b625abe876cad8f0f2801c279da684b539fce
This commit is contained in:
parent
4afef007a4
commit
9c739969f0
|
@ -377,7 +377,9 @@ Other Improvements:
|
|||
|
||||
- New builtin [JWT](https://github.com/kataras/iris/tree/master/middleware/jwt) middleware based on [square/go-jose](https://github.com/square/go-jose) featured with optional encryption to set claims with sensitive data when necessary.
|
||||
|
||||
- `Context.ReadForm` now can return an `iris.ErrEmptyForm` instead of `nil` when the new `Configuration.FireEmptyFormError` is true (or `iris.WithEmptyFormError`) on missing form body to read from.
|
||||
- New `iris.RouteOverlap` route registration rule. `Party.SetRegisterRule(iris.RouteOverlap)` to allow overlapping across multiple routes for the same request subdomain, method, path. See [1536#issuecomment-643719922](https://github.com/kataras/iris/issues/1536#issuecomment-643719922).
|
||||
|
||||
- `Context.ReadForm` now can return an `iris.ErrEmptyForm` instead of `nil` when the new `Configuration.FireEmptyFormError` is true (when `iris.WithEmptyFormError` is set) on missing form body to read from.
|
||||
|
||||
- `Configuration.EnablePathIntelligence | iris.WithPathIntelligence` to enable path intelligence automatic path redirection on the most closest path (if any), [example]((https://github.com/kataras/iris/blob/master/_examples/routing/intelligence/main.go)
|
||||
|
||||
|
|
|
@ -27,10 +27,13 @@ func main() {
|
|||
app.Post("/form_action", func(ctx iris.Context) {
|
||||
visitor := Visitor{}
|
||||
err := ctx.ReadForm(&visitor)
|
||||
if err != nil && !iris.IsErrPath(err) /* see: https://github.com/kataras/iris/issues/1157 */ {
|
||||
if err != nil {
|
||||
if !iris.IsErrPath(err) /* see: https://github.com/kataras/iris/issues/1157 */ ||
|
||||
err == iris.ErrEmptyForm {
|
||||
ctx.StopWithError(iris.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
ctx.Writef("Visitor: %#v", visitor)
|
||||
})
|
||||
|
@ -40,5 +43,5 @@ func main() {
|
|||
ctx.Writef("Username: %s", username)
|
||||
})
|
||||
|
||||
app.Listen(":8080")
|
||||
app.Listen(":8080", iris.WithEmptyFormError /* returns ErrEmptyForm if the request form body was empty */)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user