mirror of
https://github.com/labstack/echo.git
synced 2025-03-19 21:17:58 +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
|
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
|
[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
|
[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
|
[Gzip](https://labstack.com/echo/guide/middleware#gzip-middleware:37ab2f15ff048f67959bcac0a6032f32) | Send gzip HTTP response
|
||||||
|
@ -13,6 +13,8 @@ import (
|
|||||||
type (
|
type (
|
||||||
// BodyLimitConfig defines the config for body limit middleware.
|
// BodyLimitConfig defines the config for body limit middleware.
|
||||||
BodyLimitConfig struct {
|
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 string `json:"limit"`
|
||||||
limit int
|
limit int
|
||||||
}
|
}
|
||||||
@ -31,7 +33,7 @@ type (
|
|||||||
// size exceeds the configured limit, it sends "413 - Request Entity Too Large"
|
// 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`
|
// response. The body limit is determined based on the actually read and not `Content-Length`
|
||||||
// request header, which makes it super secure.
|
// 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.
|
// G, T or P.
|
||||||
func BodyLimit(limit string) echo.MiddlewareFunc {
|
func BodyLimit(limit string) echo.MiddlewareFunc {
|
||||||
return BodyLimitWithConfig(BodyLimitConfig{Limit: limit})
|
return BodyLimitWithConfig(BodyLimitConfig{Limit: limit})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user