mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
add a test near to the _examples/routing/basic example
Former-commit-id: 24b4ffc004f76355f6269a95ede3488fff9dfe36
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/kataras/iris"
|
||||
)
|
||||
|
||||
@@ -108,7 +106,7 @@ func newApp() *iris.Application {
|
||||
// to protect ourselves from "over heating".
|
||||
app.Post("/", iris.LimitRequestBodySize(maxBodySize), func(ctx iris.Context) {
|
||||
// get request body
|
||||
b, err := ioutil.ReadAll(ctx.Request().Body)
|
||||
b, err := ctx.GetBody()
|
||||
// if is larger then send a bad request status
|
||||
if err != nil {
|
||||
ctx.StatusCode(iris.StatusBadRequest)
|
||||
|
||||
Reference in New Issue
Block a user