mirror of
https://github.com/labstack/echo.git
synced 2025-03-21 21:27:04 +02:00
Updated readme
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
368f2ab67e
commit
b53170ace1
@ -233,6 +233,7 @@ e.GET("/users", func(c echo.Context) error {
|
||||
|
||||
Middleware | Description
|
||||
:--- | :---
|
||||
[BodyLimit](https://labstack.com/echo/guide/middleware#bodylimit-middleware:37ab2f15ff048f67959bcac0a6032f32) | Limit request body
|
||||
[Logger](https://labstack.com/echo/guide/middleware#logger-middleware:37ab2f15ff048f67959bcac0a6032f32) | Log HTTP requests
|
||||
[Recover](https://labstack.com/echo/guide/middleware#recover-middleware:37ab2f15ff048f67959bcac0a6032f32) | Recover from panics
|
||||
[Gzip](https://labstack.com/echo/guide/middleware#gzip-middleware:37ab2f15ff048f67959bcac0a6032f32) | Send gzip HTTP response
|
||||
|
@ -13,6 +13,8 @@ import (
|
||||
type (
|
||||
// BodyLimitConfig defines the config for body limit middleware.
|
||||
BodyLimitConfig struct {
|
||||
// Limit is the maximum allowed size for a request body, it can be specified
|
||||
// as `4x` or `4xB`, where x is one of the multiple from K, M, G, T or P.
|
||||
Limit string `json:"limit"`
|
||||
limit int
|
||||
}
|
||||
@ -31,7 +33,7 @@ type (
|
||||
// size exceeds the configured limit, it sends "413 - Request Entity Too Large"
|
||||
// response. The body limit is determined based on the actually read and not `Content-Length`
|
||||
// request header, which makes it super secure.
|
||||
// Limit can be specifed as `4x` or `4xB`, where x is one of the multple from K, M,
|
||||
// Limit can be specified as `4x` or `4xB`, where x is one of the multiple from K, M,
|
||||
// G, T or P.
|
||||
func BodyLimit(limit string) echo.MiddlewareFunc {
|
||||
return BodyLimitWithConfig(BodyLimitConfig{Limit: limit})
|
||||
|
Loading…
x
Reference in New Issue
Block a user